Skip to content

Instantly share code, notes, and snippets.

@doughgle
Created January 25, 2018 15:29
Show Gist options
  • Save doughgle/5d9ed726e9287465185982ca60519140 to your computer and use it in GitHub Desktop.
Save doughgle/5d9ed726e9287465185982ca60519140 to your computer and use it in GitHub Desktop.
#include <stdint.h>
#include <stdio.h>
long int globl_cnt = 3;
void myfunc() {
int32_t a; // variable initialized with the value of %edi register
int64_t b = 0;
int32_t c = 0;
if(c - a < 0) {
b = c * a + b;
if(c & 1) {
globl_cnt += b;
}
else {
globl_cnt -= b;
c++;
}
}
printf("a=%d, b=%ld, c=%d\nglobl_cnt=%ld\n", a, b, c, globl_cnt);
}
int main(int argc, char const *argv[]) {
myfunc();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment