Skip to content

Instantly share code, notes, and snippets.

View regehr's full-sized avatar
🎯
Focusing

John Regehr regehr

🎯
Focusing
View GitHub Profile
#include <fcntl.h>
#include <iostream>
#include <string>
#include <unistd.h>
#include <sys/wait.h>
#include <cstring>
#include "z3_pipe.h"
#define ensure(b) ensure_helper(b, __FILE__, __FUNCTION__, __LINE__)
#include <iostream>
enum e { a, c, d };
class o {
uint32_t b = 0;
void p(int c) { b |= 1 << c; }
bool s(int c) { return b >> c & 1; }
public:
void t(int f, int col, e h) {
int g = 2 * (3 * f + col);
; result 1:
%0:i8 = var ; 0
; result 2:
%0:i8 = var ; 0
%1:i8 = add 255:i8, %0
%2:i8 = add 1:i8, %1
; result 3:
%0:i8 = var ; 0
; result 1:
%0:i8 = var ; 0
; result 2:
%0:i8 = var ; 0
%1:i8 = add 0:i8, %0
; result 3:
%0:i8 = var ; 0
%1:i8 = mul 1:i8, %0
#include <stdio.h>
static unsigned f(unsigned i) { return i * 40; }
static unsigned setbit(unsigned i, unsigned b) { return i | (1U << b); }
static unsigned clearbit(unsigned i, unsigned b) { return i & ~(1U << b); }
static void testbit(unsigned b) {
printf("bit %d : ", b);
static APInt XXXones(const KnownBits &x, const KnownBits &y) {
const int WIDTH = x.One.getBitWidth();
const APInt t0 = operator+(y.Zero, APInt(WIDTH, 1));
const APInt t1 = operator+(t0, x.One);
const APInt t2 = (APInt::getSignedMinValue(WIDTH).isOneValue()) ? (x.Zero) : (x.Zero);
const APInt t3 = operator+(x.One, t2);
const APInt t4 = ~x.One;
const APInt t5 = (t4.isNegative()) ? (x.Zero) : (x.Zero);
const APInt t6 = operator-(y.Zero, t5);
APInt t7 = APInt::getAllOnesValue(WIDTH);
#include <iostream>
#include <random>
#include <functional>
#include <map>
namespace {
bool enumerate;
std::random_device rd;
----------------------------------------
define i64 @slice(i64 %0) {
%1:
%2 = shl i64 9223372036854775807, %0
ret i64 %2
}
=>
define i64 @slice(i64 %rdi) {
%0:
ret i64 -2246371524778917889
{
"arch": "amd64",
"os": "linux",
"functions": [
{
"address": 0,
"name": "slice",
"parameters": [
{
"name": "rdi",
{
"arch": "amd64",
"os": "linux",
"functions": [
{
"address": 0,
"name": "slice",
"parameters": [
{
"name": "edi",