xunge/DecIR huggingface dataset:
adrx0indreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1147 <adrx0indreg1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <adrx0indreg1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0indreg1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    (%r9),%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i16*, i16** %13
%22 = load i16, i16* %21
%23 = sext i16 %22 to i32
%24 = icmp sle i32 %20, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = load i16, i16* %5
%11 = icmp sle i16 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int test_imm_D9uint8_mem(unsigned char *val) {
  return ((*val) & (-0xD9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D9uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff27,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D9uint8_mem>:
testb  $0x27,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D9uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -217
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 39
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int atomic_exchange(volatile int *ptr, int new) {
  return __sync_lock_test_and_set(ptr, new);
}


x86 assembly (clang, -O0):
<atomic_exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
xchg   %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_exchange>:
mov    %esi,%eax
xchg   %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @atomic_exchange(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 = atomicrmw xchg i32* %5, i32 %6 seq_cst
ret i32 %7
}

LLVM IR (-O2):
define i32 @atomic_exchange(i32* nocapture %0, i32 %1) {
%3 = atomicrmw xchg i32* %0, i32 %1 seq_cst
ret i32 %3
}
/* Variables and functions */
scalar_t__ ft_strcmp(char const *, char const *);
int ft_strequ(char const *s1, char const *s2) {
  if (ft_strcmp(s1, s2) == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ft_strcmp@plt>
cmp    $0x0,%rax
jne    1143 <ft_strequ+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <ft_strequ+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
push   %rax
call   1030 <ft_strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @ft_strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = tail call i64 @ft_strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int fdevent_fcntl_set_nb_cloexec(int);
int fdevent_fcntl_set_nb_cloexec_sock(int fd) {
  return fdevent_fcntl_set_nb_cloexec(fd);
}


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

x86 assembly (clang, -O2):
<fdevent_fcntl_set_nb_cloexec_sock>:
jmp    1030 <fdevent_fcntl_set_nb_cloexec@plt>

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

LLVM IR (-O2):
define i32 @fdevent_fcntl_set_nb_cloexec_sock(i32 %0) {
%2 = tail call i32 @fdevent_fcntl_set_nb_cloexec(i32 %0)
ret i32 %2
}
int testStat(int initVal) {
  static int sm;
  int tmp = sm;
  sm = initVal;
  return tmp;
}


x86 assembly (clang, -O0):
<testStat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f17(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f0b(%rip)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStat>:
mov    0x2f1e(%rip),%eax
mov    %edi,0x2f18(%rip)
ret

LLVM IR (-O0):
@testStat.sm = internal global i32 0
define i32 @testStat(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @testStat.sm
store i32 %4, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* @testStat.sm
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@testStat.sm = internal unnamed_addr global i32 0
define i32 @testStat(i32 %0) {
%2 = load i32, i32* @testStat.sm
store i32 %0, i32* @testStat.sm
ret i32 %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRDE_set(void) { return U_WMRCORENONE_set("U_WMRDE"); }


x86 assembly (clang, -O0):
<U_WMRDE_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRDE_set>:
lea    0xee9(%rip),%rdi
jmp    1030 <U_WMRCORENONE_set@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRDE\00"
define i8* @U_WMRDE_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDE\00"
define i8* @U_WMRDE_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
scalar_t__ isWhiteSpace(char);
char *trimLeft(char *str) {
  while (str != 0 && isWhiteSpace(*str)) {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<trimLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1142 <trimLeft+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isWhiteSpace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <trimLeft+0x42>
jmp    1163 <trimLeft+0x53>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <trimLeft+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimLeft>:
push   %rbx
test   %rdi,%rdi
je     1134 <trimLeft+0x24>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isWhiteSpace@plt>
test   %rax,%rax
jne    1120 <trimLeft+0x10>
jmp    1136 <trimLeft+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @trimLeft(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %13, %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = call i64 @isWhiteSpace(i8 signext %8)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %6, %3
%12 = phi i1 [ false, %3 ], [ %10, %6 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %11
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @trimLeft(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isWhiteSpace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
char symbol() { return 'z'; }


x86 assembly (clang, -O0):
<symbol>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7a,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol>:
mov    $0x7a,%al
ret

LLVM IR (-O0):
define signext i8 @symbol() {
ret i8 122
}

LLVM IR (-O2):
define signext i8 @symbol() {
ret i8 122
}
void svprfw(long index, double value) {
  extern double *fwork;
  *(fwork + index) = value;
}


x86 assembly (clang, -O0):
<svprfw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2ed7(%rip),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<svprfw>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%rdi,8)
ret

LLVM IR (-O0):
@fwork = external global double*
define void @svprfw(i64 %0, double %1) {
%3 = alloca i64
%4 = alloca double
store i64 %0, i64* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** @fwork
%7 = load i64, i64* %3
%8 = getelementptr inbounds double, double* %6, i64 %7
store double %5, double* %8
ret void
}

LLVM IR (-O2):
@fwork = external global double*
define void @svprfw(i64 %0, double %1) {
%3 = load double*, double** @fwork
%4 = getelementptr inbounds double, double* %3, i64 %0
store double %1, double* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(const char *argv0) {
  printf("Usage: %s [OPTIONS]\n", argv0);
  printf("  --config CONFIG   specify config file path\n");
  printf("  --help            display this help and exit\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@.str.1 = [46 x i8] c" --config CONFIG specify config file path\0A\00"
@.str.2 = [48 x i8] c" --help display this help and exit\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@str = [45 x i8] c" --config CONFIG specify config file path\00"
@str.3 = [47 x i8] c" --help display this help and exit\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *trace_find_symbol(char *name, FILE *mapf) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @trace_find_symbol(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_NOW;
char *dlerror();
void *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  void *handle = NULL;
  char *path = "./dlfcn.so";
  if ((handle = dlopen(path, RTLD_NOW)) == NULL) {
    printf("dlopen - %s\n", dlerror());
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xeb2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
call   1050 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1194 <main+0x64>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119b <main+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <dlopen@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1152 <main+0x22>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"./dlfcn.so\00"
@RTLD_NOW = global i32 0
@.str.1 = [13 x i8] c"dlopen - %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @RTLD_NOW
%6 = call i8* @dlopen(i8* %4, i32 %5)
store i8* %6, i8** %2
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i8* (...) @dlerror()
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 -1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"./dlfcn.so\00"
@RTLD_NOW = global i32 0
@.str.1 = [13 x i8] c"dlopen - %s\0A\00"
define i32 @main() {
%1 = load i32, i32* @RTLD_NOW
%2 = tail call i8* @dlopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i8* (...) @dlerror()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ -1, %4 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sniff_help() {
  printf("/********************* module: sniff (dummy) "
         "**********************************/\n"
         "Sniff dummy does exactly nothing. It returns bogus data for "
         "initialization calls\n"
         "and it exits the main loop immediately. Use this in combination with "
         "the oneshot\n"
         "timer module to dump the memory to the storage engine immediately "
         "and once only.\n"
         "\n");
}


x86 assembly (clang, -O0):
<sniff_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sniff_help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [326 x i8] c"/********************* module: sniff (dummy) **********************************/\0ASniff dummy does exactly nothing. It returns bogus data for initialization calls\0Aand it exits the main loop immediately. Use this in combination with the oneshot\0Atimer module to dump the memory to the storage engine immediately and once only.\0A\0A\00"
define void @sniff_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([326 x i8], [326 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [325 x i8] c"/********************* module: sniff (dummy) **********************************/\0ASniff dummy does exactly nothing. It returns bogus data for initialization calls\0Aand it exits the main loop immediately. Use this in combination with the oneshot\0Atimer module to dump the memory to the storage engine immediately and once only.\0A\00"
define void @sniff_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([325 x i8], [325 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *t;
  if (s == NULL || (t = malloc(strlen(s) + 1)) == NULL)
    return NULL;
  strcpy(t, s);
  return t;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <strdup+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1177 <strdup+0x47>
movq   $0x0,-0x8(%rbp)
jmp    118c <strdup+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <strdup+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <strdup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <strdup+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %1, %3, %8
%11 = phi i8* [ %6, %8 ], [ null, %3 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int ap_cmd_get_int(int, int, int *);
int ap_is_playlist_looping(int session, int *looping) {
  return (ap_cmd_get_int(session, 0xcc2f, looping));
}


x86 assembly (clang, -O0):
<ap_is_playlist_looping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc2f,%esi
call   1030 <ap_cmd_get_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_is_playlist_looping>:
mov    %rsi,%rdx
mov    $0xcc2f,%esi
jmp    1030 <ap_cmd_get_int@plt>

LLVM IR (-O0):
define i32 @ap_is_playlist_looping(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 = call i32 @ap_cmd_get_int(i32 %5, i32 52271, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_is_playlist_looping(i32 %0, i32* %1) {
%3 = tail call i32 @ap_cmd_get_int(i32 %0, i32 52271, i32* %1)
ret i32 %3
}
/* Variables and functions */
char *strrchr(char *, char);
const char *extension(char *filename) {
  const char *dotpointer = strrchr(filename, '.');
  if (dotpointer == NULL)
    return "";
  return dotpointer + 1;
}


x86 assembly (clang, -O0):
<extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1149 <extension+0x39>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <extension+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xed7(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @extension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @extension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ poll(int /*<<< orphan*/, int /*<<< orphan*/, int);
long zmillisecond();
void zsleep(int delay) {
  int left = delay * 1000;
  long end = zmillisecond() + left + 1;
  while (left > 0) {
    poll(0, 0, left);
    left = end - zmillisecond();
  }
}


x86 assembly (clang, -O0):
<zsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <zmillisecond@plt>
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1182 <zsleep+0x62>
mov    -0x8(%rbp),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <poll@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <zmillisecond@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
jmp    114b <zsleep+0x2b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zsleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <zmillisecond@plt>
test   %ebp,%ebp
jle    1168 <zsleep+0x48>
mov    %rax,%rbx
imul   $0x3e8,%ebp,%edx
mov    %edx,%eax
or     $0x1,%eax
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
xor    %esi,%esi
call   1040 <poll@plt>
xor    %eax,%eax
call   1030 <zmillisecond@plt>
mov    %ebx,%edx
sub    %eax,%edx
test   %edx,%edx
jg     1150 <zsleep+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @zsleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 1000
store i32 %6, i32* %3
%7 = call i64 (...) @zmillisecond()
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
store i64 %11, i64* %4
br label %12
12: ; preds = %15, %1
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = call i32 @poll(i32 0, i32 0, i32 %16)
%18 = load i64, i64* %4
%19 = call i64 (...) @zmillisecond()
%20 = sub nsw i64 %18, %19
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
br label %12
22: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @zsleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i64 (...) @zmillisecond()
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = or i32 %2, 1
%7 = zext i32 %6 to i64
%8 = add i64 %3, %7
br label %9
9: ; preds = %5, %9
%10 = phi i32 [ %2, %5 ], [ %14, %9 ]
%11 = tail call i32 @poll(i32 0, i32 0, i32 %10)
%12 = tail call i64 (...) @zmillisecond()
%13 = sub i64 %8, %12
%14 = trunc i64 %13 to i32
%15 = icmp sgt i32 %14, 0
br i1 %15, label %9, label %16
16: ; preds = %9, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_bslli_si128(int /*<<< orphan*/, int);
__m128i __mm_bslli_si128(__m128i A, int const I) {
  return _mm_bslli_si128(A, 1);
}


x86 assembly (clang, -O0):
<__mm_bslli_si128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <_mm_bslli_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mm_bslli_si128>:
mov    $0x1,%esi
jmp    1030 <_mm_bslli_si128@plt>

LLVM IR (-O0):
define i32 @__mm_bslli_si128(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 = call i32 @_mm_bslli_si128(i32 %5, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__mm_bslli_si128(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_bslli_si128(i32 %0, i32 1)
ret i32 %3
}
void atomic_inc(int *v) { asm("lock incl %0" : "+m"(*v)); }


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

x86 assembly (clang, -O2):
<atomic_inc>:
lock incl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_inc(i32* %0) {
tail call void asm "lock incl $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x66() {
  Assert_real((isalnum(102)),
              "/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_isalnum.c",
              515, ("isalnum should be 1 for f"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x66,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x203,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x66>:
push   %rax
mov    $0x66,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x203,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for f\00"
define void @t_isalnum_0x66() {
%1 = call i32 @isalnum(i32 102)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for f\00"
define void @t_isalnum_0x66() {
%1 = tail call i32 @isalnum(i32 102)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float *malloc(unsigned int);
float *create_farray(unsigned int length, unsigned int row) {
  return malloc(length * row * sizeof(float));
}


x86 assembly (clang, -O0):
<create_farray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_farray>:
imul   %esi,%edi
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define float* @create_farray(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 = mul i32 %5, %6
%8 = zext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call float* @malloc(i32 %10)
ret float* %11
}

LLVM IR (-O2):
define noalias float* @create_farray(i32 %0, i32 %1) {
%3 = shl i32 %0, 2
%4 = mul i32 %3, %1
%5 = tail call float* @malloc(i32 %4)
ret float* %5
}
/* Variables and functions */
int parseNparams(char const *, int, int, unsigned int **);
int parse1params(const char *params, int required, unsigned int *p1) {
  unsigned int *p[] = {p1};
  return parseNparams(params, required, 1, p);
}


x86 assembly (clang, -O0):
<parse1params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <parseNparams@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse1params>:
push   %rax
mov    %rdx,(%rsp)
mov    %rsp,%rcx
mov    $0x1,%edx
call   1030 <parseNparams@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parse1params(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [1 x i32*]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = getelementptr inbounds [1 x i32*], [1 x i32*]* %7, i64 0, i64 0
%9 = load i32*, i32** %6
store i32* %9, i32** %8
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = getelementptr inbounds [1 x i32*], [1 x i32*]* %7, i64 0, i64 0
%13 = call i32 @parseNparams(i8* %10, i32 %11, i32 1, i32** %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @parse1params(i8* %0, i32 %1, i32* %2) {
%4 = alloca [1 x i32*]
%5 = bitcast [1 x i32*]* %4 to i8*
%6 = getelementptr inbounds [1 x i32*], [1 x i32*]* %4, i64 0, i64 0
store i32* %2, i32** %6
%7 = call i32 @parseNparams(i8* %0, i32 %1, i32 1, i32** %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ktr_err_parse(char *);
void yyerror(char *string) { ktr_err_parse(string); }


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

x86 assembly (clang, -O2):
<yyerror>:
jmp    1030 <ktr_err_parse@plt>

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

LLVM IR (-O2):
define void @yyerror(i8* %0) {
%2 = tail call i32 @ktr_err_parse(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int _close(int fd) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_close(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void fn_vli(long l, int i) {
  (void)l;
  (void)i;
  abort();
}


x86 assembly (clang, -O0):
<fn_vli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<fn_vli>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fn_vli(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @fn_vli(i64 %0, i32 %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
int __ocl_convert_int_char_sat(char src) { return src; }


x86 assembly (clang, -O0):
<__ocl_convert_int_char_sat>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_convert_int_char_sat>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @__ocl_convert_int_char_sat(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @__ocl_convert_int_char_sat(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
void I2C1_ER_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @I2C1_ER_IRQHandler() {
ret void
}
/* Variables and functions */
char toupper(char);
void strtoupper(char *str) {
  while (*str) {
    *str = toupper(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strtoupper+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strtoupper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @strtoupper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %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 signext i8 @toupper(i8 signext %9)
%11 = load i8*, i8** %2
store i8 %10, i8* %11
%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 @strtoupper(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 signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%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 setbit(char *set, int number, int value) {
  set += number / 8;
  if (value)
    *set |= 1 << (number % 8);
  else
    *set &= ~(1 << (number % 8));
}


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1157 <setbit+0x57>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
jmp    1179 <setbit+0x79>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0x7,%cl
mov    $0x1,%esi
shl    %cl,%esi
sar    $0x3,%eax
movslq %eax,%r8
mov    (%rdi,%r8,1),%cl
mov    %esi,%eax
not    %al
and    %cl,%al
or     %sil,%cl
test   %edx,%edx
movzbl %al,%eax
movzbl %cl,%ecx
cmove  %eax,%ecx
mov    %cl,(%rdi,%r8,1)
ret

LLVM IR (-O0):
define void @setbit(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 i32, i32* %5
%8 = sdiv i32 %7, 8
%9 = load i8*, i8** %4
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %4
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %3
%15 = load i32, i32* %5
%16 = srem i32 %15, 8
%17 = shl i32 1, %16
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = or i32 %20, %17
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
br label %33
23: ; preds = %3
%24 = load i32, i32* %5
%25 = srem i32 %24, 8
%26 = shl i32 1, %25
%27 = xor i32 %26, -1
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = and i32 %30, %27
%32 = trunc i32 %31 to i8
store i8 %32, i8* %28
br label %33
33: ; preds = %23, %14
ret void
}

LLVM IR (-O2):
define void @setbit(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = icmp eq i32 %2, 0
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = load i8, i8* %6
%11 = trunc i32 %9 to i8
%12 = xor i8 %11, -1
%13 = and i8 %10, %12
%14 = or i8 %10, %11
%15 = select i1 %7, i8 %13, i8 %14
store i8 %15, i8* %6
ret void
}
int test5(char x) { return x / 100 > 3; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test5(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp sgt i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test5(i8 signext %0) {
ret i32 0
}
/* Variables and functions */
double alea();
double c1(void) { return 0.9 + 0.2 * alea(); }


x86 assembly (clang, -O0):
<c1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <alea@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c1>:
push   %rax
xor    %eax,%eax
call   1030 <alea@plt>
mulsd  0xee0(%rip),%xmm0
addsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @c1() {
%1 = call double (...) @alea()
%2 = call double @llvm.fmuladd.f64(double 2.000000e-01, double %1, double 9.000000e-01)
ret double %2
}

LLVM IR (-O2):
define double @c1() {
%1 = tail call double (...) @alea()
%2 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e-01, double 9.000000e-01)
ret double %2
}
void cc3_pixbuf_frame_reset() {}


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

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

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

LLVM IR (-O2):
define void @cc3_pixbuf_frame_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_in_range_2(int, int);
int /*<<< orphan*/ assert_in_wide_range(int);
int /*<<< orphan*/ clang_analyzer_eval(int);
void non_equal(int m, int n) {
  assert_in_range_2(m, n);
  if (m == n)
    return;
  assert_in_wide_range(m - n);
  clang_analyzer_eval(n != m);
}


x86 assembly (clang, -O0):
<non_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <assert_in_range_2@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115a <non_equal+0x2a>
jmp    1178 <non_equal+0x48>
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1040 <assert_in_wide_range@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<non_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <assert_in_range_2@plt>
sub    %ebp,%ebx
jne    1147 <non_equal+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebx,%edi
call   1040 <assert_in_wide_range@plt>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @non_equal(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 = call i32 @assert_in_range_2(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
br label %22
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = call i32 @assert_in_wide_range(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp ne i32 %17, %18
%20 = zext i1 %19 to i32
%21 = call i32 @clang_analyzer_eval(i32 %20)
br label %22
22: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @non_equal(i32 %0, i32 %1) {
%3 = tail call i32 @assert_in_range_2(i32 %0, i32 %1)
%4 = icmp eq i32 %0, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = sub nsw i32 %0, %1
%7 = tail call i32 @assert_in_wide_range(i32 %6)
%8 = tail call i32 @clang_analyzer_eval(i32 1)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void clean_buff(char *buff) {
  memset(buff, 0, 1024);
  return;
}


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

x86 assembly (clang, -O2):
<clean_buff>:
xor    %esi,%esi
mov    $0x400,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clean_buff(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 1024)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_exit_handler1(void) { printf("exit function1\n"); }


x86 assembly (clang, -O0):
<my_exit_handler1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_exit_handler1>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"exit function1\0A\00"
define void @my_exit_handler1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"exit function1\00"
define void @my_exit_handler1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *custom_calloc(size_t nmemb, size_t size) {
  if (nmemb == 0 || size == 0)
    return (NULL);
  return (calloc(nmemb, size));
}


x86 assembly (clang, -O0):
<custom_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <custom_calloc+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <custom_calloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1154 <custom_calloc+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_calloc>:
test   %rdi,%rdi
je     111f <custom_calloc+0xf>
test   %rsi,%rsi
je     111f <custom_calloc+0xf>
jmp    1030 <calloc@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @custom_calloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
int test_imm_C8int16_reg(short val) {
  return ((val) & (-0xC8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C8int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff38,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C8int16_reg>:
test   $0xff38,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C8int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -200
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C8int16_reg(i16 signext %0) {
%2 = and i16 %0, -200
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}