xunge/DecIR huggingface dataset:
/* Variables and functions */
char const *basename(char *);
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
char *fp_base(const char *path) {
  char *p = strdup(path), *base = NULL;
  if (!p) {
    return NULL;
  }
  base = strdup(basename(p));
  free(p);
  return base;
}


x86 assembly (clang, -O0):
<fp_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <fp_base+0x39>
movq   $0x0,-0x8(%rbp)
jmp    118f <fp_base+0x5f>
mov    -0x18(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_base>:
push   %r14
push   %rbx
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     1161 <fp_base+0x31>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1163 <fp_base+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @fp_base(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %4
store i8* null, i8** %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i8* null, i8** %2
br label %18
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i8* @basename(i8* %12)
%14 = call i8* @strdup(i8* %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %5
store i8* %17, i8** %2
br label %18
18: ; preds = %11, %10
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @fp_base(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @basename(i8* %2)
%6 = tail call i8* @strdup(i8* %5)
%7 = tail call i32 @free(i8* %2)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ ts;
struct timex {
  int /*<<< orphan*/ modes;
};

/* Variables and functions */
int /*<<< orphan*/ ADJ_STATUS;
int /*<<< orphan*/ adjtimex(struct timex *);
int /*<<< orphan*/ memset(struct timex *, int /*<<< orphan*/, int);
int main() {
  static struct timex ts;
  memset(&ts, 0, sizeof(ts));
  ts.modes = ADJ_STATUS;
  adjtimex(&ts);
  adjtimex((struct timex *)-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2efe(%rip),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2ee3(%rip)
lea    0x2edc(%rip),%rdi
call   1040 <adjtimex@plt>
mov    $0xffffffffffffffff,%rdi
call   1040 <adjtimex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0x2f0c(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2eee(%rip)
mov    %rbx,%rdi
call   1040 <adjtimex@plt>
mov    $0xffffffffffffffff,%rdi
call   1040 <adjtimex@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.timex = type { i32 }
@main.ts = internal global %struct.timex zeroinitializer
@ADJ_STATUS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @memset(%struct.timex* @main.ts, i32 0, i32 4)
%3 = load i32, i32* @ADJ_STATUS
store i32 %3, i32* getelementptr inbounds (%struct.timex, %struct.timex* @main.ts, i32 0, i32 0)
%4 = call i32 @adjtimex(%struct.timex* @main.ts)
%5 = call i32 @adjtimex(%struct.timex* inttoptr (i64 -1 to %struct.timex*))
ret i32 0
}

LLVM IR (-O2):
%struct.timex = type { i32 }
@main.ts = internal global %struct.timex zeroinitializer
@ADJ_STATUS = global i32 0
define i32 @main() {
%1 = tail call i32 @memset(%struct.timex* @main.ts, i32 0, i32 4)
%2 = load i32, i32* @ADJ_STATUS
store i32 %2, i32* getelementptr inbounds (%struct.timex, %struct.timex* @main.ts, i64 0, i32 0)
%3 = tail call i32 @adjtimex(%struct.timex* @main.ts)
%4 = tail call i32 @adjtimex(%struct.timex* inttoptr (i64 -1 to %struct.timex*))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/ *);
int maxFreqFromBinFile(FILE *maxFreqFile, int *maxFreq, int totalDocs) {
  fread(maxFreq, sizeof(int), totalDocs, maxFreqFile);
  return 1;
}


x86 assembly (clang, -O0):
<maxFreqFromBinFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
call   1030 <fread@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxFreqFromBinFile>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
call   1030 <fread@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @maxFreqFromBinFile(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @fread(i32* %7, i32 4, i32 %8, i32* %9)
ret i32 1
}

LLVM IR (-O2):
define i32 @maxFreqFromBinFile(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @fread(i32* %1, i32 4, i32 %2, i32* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void puts(char *s) {
  for (; *s; s++)
    putchar(*s);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %11, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @putchar(i8 signext %9)
br label %11
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void specks_unlock(struct stuff *st) {}


x86 assembly (clang, -O0):
<specks_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<specks_unlock>:
ret

LLVM IR (-O0):
%struct.stuff = type opaque
define void @specks_unlock(%struct.stuff* %0) {
%2 = alloca %struct.stuff*
store %struct.stuff* %0, %struct.stuff** %2
ret void
}

LLVM IR (-O2):
%struct.stuff = type opaque
define void @specks_unlock(%struct.stuff* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_read_shadow_stack_metadata_store(char **,
                                                                    int);
long strtol(char const *, char **, int);
__attribute__((__weak__, __always___)) long
softboundcets_strtol(const char *nptr, char **endptr, int base) {
  long temp = strtol(nptr, endptr, base);
  if (endptr != NULL) {
    __softboundcets_read_shadow_stack_metadata_store(endptr, 1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<softboundcets_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strtol@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <softboundcets_strtol+0x40>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <__softboundcets_read_shadow_stack_metadata_store@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_strtol>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <strtol@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1141 <softboundcets_strtol+0x21>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <__softboundcets_read_shadow_stack_metadata_store@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define weak i64 @softboundcets_strtol(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %5
%10 = load i32, i32* %6
%11 = call i64 @strtol(i8* %8, i8** %9, i32 %10)
store i64 %11, i64* %7
%12 = load i8**, i8*** %5
%13 = icmp ne i8** %12, null
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i8**, i8*** %5
%16 = call i32 @__softboundcets_read_shadow_stack_metadata_store(i8** %15, i32 1)
br label %17
17: ; preds = %14, %3
%18 = load i64, i64* %7
ret i64 %18
}

LLVM IR (-O2):
define weak i64 @softboundcets_strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strtol(i8* %0, i8** %1, i32 %2)
%5 = icmp eq i8** %1, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @__softboundcets_read_shadow_stack_metadata_store(i8** %1, i32 1)
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_init(pthread_mutex_t *mutex, pthread_mutexattr_t *mattr) {
  return 0;
}


x86 assembly (clang, -O0):
<pthread_mutex_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pthread_mutex_init(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_mutex_init(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t new_uint16_t(void) { return 0; }


x86 assembly (clang, -O0):
<new_uint16_t>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_uint16_t>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @new_uint16_t() {
ret i32 0
}

LLVM IR (-O2):
define i32 @new_uint16_t() {
ret i32 0
}
void target_done(void) {}


x86 assembly (clang, -O0):
<target_done>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_done>:
ret

LLVM IR (-O0):
define void @target_done() {
ret void
}

LLVM IR (-O2):
define void @target_done() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcslen(int /*<<< orphan*/ *);
void uninitvar_wcslen(void) {
  wchar_t *s;
  (void)wcslen(s);
}


x86 assembly (clang, -O0):
<uninitvar_wcslen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1030 <wcslen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wcslen>:
ret

LLVM IR (-O0):
define void @uninitvar_wcslen() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @wcslen(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcslen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(char *);
void *thread(void *arg) {
  printf("thread 1 running\n");
  pthread_exit("thread is over");
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %rax
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"thread 1 running\0A\00"
@.str.1 = [15 x i8] c"thread is over\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"thread is over\00"
@str = [17 x i8] c"thread 1 running\00"
define noalias i8* @thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int f430(int *);
int f431(int *p) { return f430(p); }


x86 assembly (clang, -O0):
<f431>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f430@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f431>:
jmp    1030 <f430@plt>

LLVM IR (-O0):
define i32 @f431(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f430(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f431(i32* %0) {
%2 = tail call i32 @f430(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ DSA;

/* Variables and functions */
int /*<<< orphan*/ DSA_up_ref(int /*<<< orphan*/ *);
int EVP_PKEY_assign_DSA(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) {
  int ret = EVP_PKEY_assign_DSA(pkey, key);
  if (ret != 0)
    DSA_up_ref(key);
  return ret;
}


x86 assembly (clang, -O0):
<EVP_PKEY_set1_DSA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <EVP_PKEY_assign_DSA@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <EVP_PKEY_set1_DSA+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <DSA_up_ref@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set1_DSA>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <EVP_PKEY_assign_DSA@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1139 <EVP_PKEY_set1_DSA+0x19>
mov    %rbx,%rdi
call   1030 <DSA_up_ref@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @EVP_PKEY_set1_DSA(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @EVP_PKEY_assign_DSA(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = call i32 @DSA_up_ref(i32* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @EVP_PKEY_set1_DSA(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_PKEY_assign_DSA(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @DSA_up_ref(i32* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ uxmi_color_fg(int);
void uxmi_cfg_testrc(int rc) {
  if (rc) {
    uxmi_color_fg(12);
    printf("\t\t\t FAILED \n");
  } else {
    uxmi_color_fg(10);
    printf("\t\t\t OK \n");
  }
  return;
}


x86 assembly (clang, -O0):
<uxmi_cfg_testrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <uxmi_cfg_testrc+0x30>
mov    $0xc,%edi
call   1040 <uxmi_color_fg@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <uxmi_cfg_testrc+0x46>
mov    $0xa,%edi
call   1040 <uxmi_color_fg@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uxmi_cfg_testrc>:
push   %rbx
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    0xa(%rax,%rax,1),%edi
lea    0xecd(%rip),%rax
lea    0xece(%rip),%rbx
cmove  %rax,%rbx
call   1040 <uxmi_color_fg@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09\09\09 FAILED \0A\00"
@.str.1 = [9 x i8] c"\09\09\09 OK \0A\00"
define void @uxmi_cfg_testrc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @uxmi_color_fg(i32 12)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = call i32 @uxmi_color_fg(i32 10)
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"\09\09\09 OK \00"
@str.2 = [12 x i8] c"\09\09\09 FAILED \00"
define void @uxmi_cfg_testrc(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 10, i32 12
%4 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0)
%5 = tail call i32 @uxmi_color_fg(i32 %3)
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_binary(int number) {
  if (number) {
    print_binary(number >> 1);
    putc((number & 1) ? '1' : '0', stdout);
  }
}


x86 assembly (clang, -O0):
<print_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1167 <print_binary+0x47>
mov    -0x4(%rbp),%edi
sar    $0x1,%edi
call   1040 <print_binary@plt>
mov    -0x4(%rbp),%edx
and    $0x1,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    0x2e83(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_binary>:
test   %edi,%edi
je     1146 <print_binary+0x26>
push   %rbx
mov    %edi,%ebx
sar    %edi
call   1040 <print_binary@plt>
and    $0x1,%bl
or     $0x30,%bl
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putc@plt>
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @print_binary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 49, i32 48
%13 = trunc i32 %12 to i8
%14 = load i32, i32* @stdout
%15 = call i32 @putc(i8 signext %13, i32 %14)
br label %16
16: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_binary(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = ashr i32 %0, 1
tail call void @print_binary(i32 %5)
%6 = trunc i32 %0 to i8
%7 = and i8 %6, 1
%8 = or i8 %7, 48
%9 = load i32, i32* @stdout
%10 = tail call i32 @putc(i8 signext %8, i32 %9)
br label %3
}
/* Type definitions */
struct dcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dbg_break();
void vmkit_vmenter(struct dcb *dcb) {
  dbg_break();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<vmkit_vmenter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dbg_break@plt>
jmp    1123 <vmkit_vmenter+0x13>

x86 assembly (clang, -O2):
<vmkit_vmenter>:
push   %rax
xor    %eax,%eax
call   1030 <dbg_break@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <vmkit_vmenter+0x10>

LLVM IR (-O0):
%struct.dcb = type { i32 }
define void @vmkit_vmenter(%struct.dcb* %0) {
%2 = alloca %struct.dcb*
store %struct.dcb* %0, %struct.dcb** %2
%3 = call i32 (...) @dbg_break()
br label %4
4: ; preds = %4, %1
br label %4
}

LLVM IR (-O2):
%struct.dcb = type { i32 }
define void @vmkit_vmenter(%struct.dcb* nocapture readnone %0) {
%2 = tail call i32 (...) @dbg_break()
br label %3
3: ; preds = %3, %1
br label %3
}
int store_jump(from, opcode, to)
char *from, *to;
char opcode;
{
  from[0] = opcode;
  from[1] = (to - (from + 3)) & 0377;
  from[2] = (to - (from + 3)) >> 8;
}


x86 assembly (clang, -O0):
<store_jump>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x3,%rcx
sub    %rcx,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x3,%rcx
sub    %rcx,%rax
sar    $0x8,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_jump>:
mov    %sil,(%rdi)
sub    %rdi,%rdx
add    $0xfffffffffffffffd,%rdx
mov    %dl,0x1(%rdi)
mov    %dh,0x2(%rdi)
ret

LLVM IR (-O0):
define i32 @store_jump(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
%8 = trunc i32 %1 to i8
store i8* %0, i8** %5
store i8 %8, i8* %6
store i8* %2, i8** %7
%9 = load i8, i8* %6
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %7
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 3
%15 = ptrtoint i8* %12 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 %19, i8* %21
%22 = load i8*, i8** %7
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = ptrtoint i8* %22 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
%28 = ashr i64 %27, 8
%29 = trunc i64 %28 to i8
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 %29, i8* %31
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
define i32 @store_jump(i8* %0, i32 %1, i8* %2) {
%4 = trunc i32 %1 to i8
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = ptrtoint i8* %2 to i64
%7 = ptrtoint i8* %5 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %8, 8
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %12, i8* %13
ret i32 undef
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t pcg_rotr_32(uint32_t value, unsigned int rot) {
  return (value >> rot) | (value << ((-rot) & 31));
}


x86 assembly (clang, -O0):
<pcg_rotr_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_rotr_32>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @pcg_rotr_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = and i32 %10, 31
%12 = shl i32 %8, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @pcg_rotr_32(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 0, %1
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
int main(void) {
  for (int counter = 0; counter < 5; counter++) {
    if (2 == counter) {
      continue;
    }
    if (3 == counter) {
      continue;
    }
    if (4 == counter) {
      continue;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1168 <main+0x68>
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jne    112f <main+0x2f>
jmp    115a <main+0x5a>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    1142 <main+0x42>
jmp    115a <main+0x5a>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jne    1155 <main+0x55>
jmp    115a <main+0x5a>
jmp    115a <main+0x5a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %22
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 2, %7
br i1 %8, label %9, label %10
9: ; preds = %6
br label %19
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 3, %11
br i1 %12, label %13, label %14
13: ; preds = %10
br label %19
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp eq i32 4, %15
br i1 %16, label %17, label %18
17: ; preds = %14
br label %19
18: ; preds = %14
br label %19
19: ; preds = %18, %17, %13, %9
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %3
22: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
void Swap_Values(char *data1, char *data2) {
  char *temp = malloc(100 * sizeof(char));
  strcpy(temp, data1);
  strcpy(data1, data2);
  strcpy(data2, temp);
  free(temp);
}


x86 assembly (clang, -O0):
<Swap_Values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap_Values>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @Swap_Values(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i32 100)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
define void @Swap_Values(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
%5 = tail call i32 @strcpy(i8* %0, i8* %1)
%6 = tail call i32 @strcpy(i8* %1, i8* %3)
%7 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello dummy\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello dummy\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello dummy\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
int UnixVfs_Sleep(unsigned int uSec) {
  usleep(uSec);
  return 0;
}


x86 assembly (clang, -O0):
<UnixVfs_Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnixVfs_Sleep>:
push   %rax
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UnixVfs_Sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @usleep(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @UnixVfs_Sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret i32 0
}
int isxdigit(int c) {
  return (((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'F')) ||
          ((c >= 'a') && (c <= 'f')));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x66,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 70
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 102
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ spiWriteRegister(int, int);
void clearFIFO() {
  spiWriteRegister(0x08, 0x03);
  spiWriteRegister(0x08, 0x00);
}


x86 assembly (clang, -O0):
<clearFIFO>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x3,%esi
call   1030 <spiWriteRegister@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <spiWriteRegister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearFIFO>:
push   %rax
mov    $0x8,%edi
mov    $0x3,%esi
call   1030 <spiWriteRegister@plt>
mov    $0x8,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <spiWriteRegister@plt>

LLVM IR (-O0):
define void @clearFIFO() {
%1 = call i32 @spiWriteRegister(i32 8, i32 3)
%2 = call i32 @spiWriteRegister(i32 8, i32 0)
ret void
}

LLVM IR (-O2):
define void @clearFIFO() {
%1 = tail call i32 @spiWriteRegister(i32 8, i32 3)
%2 = tail call i32 @spiWriteRegister(i32 8, i32 0)
ret void
}
int foo(int x) {
  int tem = x / 3;
  return tem / 5;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 3
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 5
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = sdiv i32 %0, 15
ret i32 %2
}
int z(double i) { return (i + (-2.0)) > i; }


x86 assembly (clang, -O0):
<z>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @z(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, -2.000000e+00
%5 = load double, double* %2
%6 = fcmp ogt double %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @z(double %0) {
%2 = fadd double %0, -2.000000e+00
%3 = fcmp ogt double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xda() {
  Assert_real((islower(218) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1095, ("islower should be 0 for 0xda"));
}


x86 assembly (clang, -O0):
<t_islower_0xda>:
push   %rbp
mov    %rsp,%rbp
mov    $0xda,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x447,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xda>:
push   %rax
mov    $0xda,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x447,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xda\00"
define void @t_islower_0xda() {
%1 = call i64 @islower(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xda\00"
define void @t_islower_0xda() {
%1 = tail call i64 @islower(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SkipListCursorFree(void *);
void SkipListDBCursorFree(void *cursor) { SkipListCursorFree(cursor); }


x86 assembly (clang, -O0):
<SkipListDBCursorFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SkipListCursorFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipListDBCursorFree>:
jmp    1030 <SkipListCursorFree@plt>

LLVM IR (-O0):
define void @SkipListDBCursorFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @SkipListCursorFree(i8* %3)
ret void
}

LLVM IR (-O2):
define void @SkipListDBCursorFree(i8* %0) {
%2 = tail call i32 @SkipListCursorFree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_init();
void cpu_reset(void) { cpu_init(); }


x86 assembly (clang, -O0):
<cpu_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cpu_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_reset>:
xor    %eax,%eax
jmp    1030 <cpu_init@plt>

LLVM IR (-O0):
define void @cpu_reset() {
%1 = call i32 (...) @cpu_init()
ret void
}

LLVM IR (-O2):
define void @cpu_reset() {
%1 = tail call i32 (...) @cpu_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int foo();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main() {
  int rc;
  printf("hello");
  fflush(stdout);
  rc = foo();
  printf("world\n");
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   1050 <foo@plt>
mov    %eax,-0x8(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1060 <foo@plt>
mov    %eax,%ebx
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"world\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 (...) @foo()
store i32 %6, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@stdout = global i32 0
@str = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @foo()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 %4
}
int additional(int x, int y) { return x + y; }


x86 assembly (clang, -O0):
<additional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<additional>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @additional(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @additional(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ chronometer_thread_start();
int /*<<< orphan*/ shell_interpreter_start();
int /*<<< orphan*/ thermometer_thread_start();
int /*<<< orphan*/ touchmanager_thread_start();
void startup_threads_start() {
  thermometer_thread_start();
  chronometer_thread_start();
  touchmanager_thread_start();
  shell_interpreter_start();
}


x86 assembly (clang, -O0):
<startup_threads_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <thermometer_thread_start@plt>
mov    $0x0,%al
call   1050 <chronometer_thread_start@plt>
mov    $0x0,%al
call   1040 <touchmanager_thread_start@plt>
mov    $0x0,%al
call   1030 <shell_interpreter_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startup_threads_start>:
push   %rax
xor    %eax,%eax
call   1060 <thermometer_thread_start@plt>
xor    %eax,%eax
call   1050 <chronometer_thread_start@plt>
xor    %eax,%eax
call   1040 <touchmanager_thread_start@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <shell_interpreter_start@plt>

LLVM IR (-O0):
define void @startup_threads_start() {
%1 = call i32 (...) @thermometer_thread_start()
%2 = call i32 (...) @chronometer_thread_start()
%3 = call i32 (...) @touchmanager_thread_start()
%4 = call i32 (...) @shell_interpreter_start()
ret void
}

LLVM IR (-O2):
define void @startup_threads_start() {
%1 = tail call i32 (...) @thermometer_thread_start()
%2 = tail call i32 (...) @chronometer_thread_start()
%3 = tail call i32 (...) @touchmanager_thread_start()
%4 = tail call i32 (...) @shell_interpreter_start()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *dirname(char *);
int /*<<< orphan*/ free(char *);
char *xstrdup(char *);
char *directory_name(char *path) {
  char *copy;
  char *name;
  assert(path != NULL);
  copy = xstrdup(path);
  name = xstrdup(dirname(copy));
  free(copy);
  return name;
}


x86 assembly (clang, -O0):
<directory_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dirname@plt>
mov    %rax,%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<directory_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
call   1050 <xstrdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <dirname@plt>
mov    %rax,%rdi
call   1050 <xstrdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @directory_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %2
%10 = call i8* @xstrdup(i8* %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i8* @dirname(i8* %11)
%13 = call i8* @xstrdup(i8* %12)
store i8* %13, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @directory_name(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @xstrdup(i8* %0)
%6 = tail call i8* @dirname(i8* %5)
%7 = tail call i8* @xstrdup(i8* %6)
%8 = tail call i32 @free(i8* %5)
ret i8* %7
}
void d(int s) { char b[s]; }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
ret

LLVM IR (-O0):
define void @d(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @d(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int print_space(int j, FILE *fp) {
  int i;
  for (i = 0; i < j; i++)
    fprintf(fp, "%s", " ");
  return (1);
}


x86 assembly (clang, -O0):
<print_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1157 <print_space+0x47>
mov    -0x10(%rbp),%rdi
lea    0xec3(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_space+0x16>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_space>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1132 <print_space+0x22>
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1120 <print_space+0x10>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c" \00"
define i32 @print_space(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret i32 1
}

LLVM IR (-O2):
define i32 @print_space(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 32, i32* %1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ djbhash(char const *, int /*<<< orphan*/ const,
                           int /*<<< orphan*/);
__attribute__((__no__)) __attribute__((__pure__)) u_int32_t
gw_hash(const char *str, const u_int32_t len, u_int32_t hash) {
  return djbhash(str, len, hash);
}


x86 assembly (clang, -O0):
<gw_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <djbhash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gw_hash>:
jmp    1030 <djbhash@plt>

LLVM IR (-O0):
define i32 @gw_hash(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @djbhash(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @gw_hash(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @djbhash(i8* %0, i32 %1, i32 %2)
ret i32 %4
}