xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ memcmp(void *, void const *, unsigned int const);
int /*<<< orphan*/ memcpy(void *, void const *, unsigned int const);
bool copy_if_changed(void *dst, const void *src, const unsigned int length) {
  bool changed = false;
  if (memcmp(dst, src, length)) {
    memcpy(dst, src, length);
    changed = true;
  }
  return changed;
}


x86 assembly (clang, -O0):
<copy_if_changed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     116b <copy_if_changed+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_if_changed>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <memcmp@plt>
test   %rax,%rax
je     114c <copy_if_changed+0x2c>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <memcpy@plt>
mov    $0x1,%eax
jmp    114e <copy_if_changed+0x2e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @copy_if_changed(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int de_feat_is_support_wb(unsigned int);
int bsp_disp_feat_is_support_capture(unsigned int disp) {
  return de_feat_is_support_wb(disp);
}


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

x86 assembly (clang, -O2):
<bsp_disp_feat_is_support_capture>:
jmp    1030 <de_feat_is_support_wb@plt>

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

LLVM IR (-O2):
define i32 @bsp_disp_feat_is_support_capture(i32 %0) {
%2 = tail call i32 @de_feat_is_support_wb(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ doit(int);
int main(int argc, char **argv) {
  doit(argc);
  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)
mov    -0x8(%rbp),%edi
call   1030 <doit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = call i32 @doit(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @doit(i32 %0)
ret i32 0
}
void WebPInitPremultiplyNEON(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitPremultiplyNEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ x1();
int /*<<< orphan*/ x2();
int main(int argc, char *argv[]) {
  x1();
  x2();
  exit(EXIT_SUCCESS);
}


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)
mov    $0x0,%al
call   1040 <x1@plt>
mov    $0x0,%al
call   1030 <x2@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <x1@plt>
xor    %eax,%eax
call   1030 <x2@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @x1()
%7 = call i32 (...) @x2()
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @x1()
%4 = tail call i32 (...) @x2()
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void v4f(vec) float vec[4];
{ vcall(vec, 4); }


x86 assembly (clang, -O0):
<v4f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4f>:
mov    $0x4,%esi
xor    %eax,%eax
jmp    1030 <vcall@plt>

LLVM IR (-O0):
define void @v4f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4f(float* %0) {
%2 = tail call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %0, i32 4)
ret void
}
/* Type definitions */
typedef scalar_t__ const int64_t;

/* Variables and functions */
extern int64_t sub64(const int64_t a, const int64_t b) { return a - b; }


x86 assembly (clang, -O0):
<sub64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub64>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @sub64(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
FILE *OpenFile(const char *name, const char *mode) {
  FILE *fp;
  fp = fopen(name, mode);
  if ((NULL == (fp))) {
    printf("Cannot open file %s: %s\n", name, strerror(errno));
  }
  return fp;
}


x86 assembly (clang, -O0):
<OpenFile>:
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 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1186 <OpenFile+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1164 <OpenFile+0x34>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea7(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Cannot open file %s: %s\0A\00"
@errno = global i32 0
define i32* @OpenFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* null, %9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* @errno
%14 = call i8* @strerror(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %14)
br label %16
16: ; preds = %11, %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@.str = [25 x i8] c"Cannot open file %s: %s\0A\00"
@errno = global i32 0
define noalias i32* @OpenFile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
br label %9
9: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
void open_syslog(char *nam) { openlog(nam, LOG_NDELAY | LOG_PID, LOG_DAEMON); }


x86 assembly (clang, -O0):
<open_syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_syslog>:
mov    0x2eb1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @open_syslog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_NDELAY
%5 = load i32, i32* @LOG_PID
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_DAEMON
%8 = call i32 @openlog(i8* %3, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @open_syslog(i8* %0) {
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_PID
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_DAEMON
%6 = tail call i32 @openlog(i8* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_3030() {
  Assert_real((isqrt(3030) == 55),
              "/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/stdlib/isqrt.c",
              1330, ("Integer square root of 3030 should be 55"));
}


x86 assembly (clang, -O0):
<t_sqrt_3030>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbd6,%edi
call   1030 <isqrt@plt>
cmp    $0x37,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x532,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_3030>:
push   %rax
mov    $0xbd6,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x37,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x532,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 3030 should be 55\00"
define void @t_sqrt_3030() {
%1 = call i32 @isqrt(i32 3030)
%2 = icmp eq i32 %1, 55
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1330, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 3030 should be 55\00"
define void @t_sqrt_3030() {
%1 = tail call i32 @isqrt(i32 3030)
%2 = icmp eq i32 %1, 55
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1330, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fval(int newlib, int minlib) {
  int k, val;
  if (newlib <= minlib)
    val = -1;
  else {
    k = newlib - minlib;
    val = 40 + (k - 1) * 50 / (minlib * minlib * minlib);
  }
  return val;
}


x86 assembly (clang, -O0):
<fval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1122 <fval+0x22>
movl   $0xffffffff,-0x10(%rbp)
jmp    1148 <fval+0x48>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
imul   $0x32,%eax,%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cltd
idiv   %ecx
add    $0x28,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fval>:
mov    $0xffffffff,%eax
cmp    %esi,%edi
jle    1120 <fval+0x20>
mov    %esi,%eax
not    %eax
add    %edi,%eax
imul   $0x32,%eax,%eax
mov    %esi,%ecx
imul   %esi,%ecx
imul   %esi,%ecx
cltd
idiv   %ecx
add    $0x28,%eax
ret

LLVM IR (-O0):
define i32 @fval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %6
br label %25
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = mul nsw i32 %16, 50
%18 = load i32, i32* %4
%19 = load i32, i32* %4
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %4
%22 = mul nsw i32 %20, %21
%23 = sdiv i32 %17, %22
%24 = add nsw i32 40, %23
store i32 %24, i32* %6
br label %25
25: ; preds = %11, %10
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @fval(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = xor i32 %1, -1
%6 = add i32 %5, %0
%7 = mul nsw i32 %6, 50
%8 = mul nsw i32 %1, %1
%9 = mul nsw i32 %8, %1
%10 = sdiv i32 %7, %9
%11 = add nsw i32 %10, 40
br label %12
12: ; preds = %2, %4
%13 = phi i32 [ %11, %4 ], [ -1, %2 ]
ret i32 %13
}
int main() {
  signed int i;
  signed short int si;
  i = 0;
  si = 0x0001;
  i = si;
  i = 0;
  si = 0xFFFF;
  i = si;
  i = 0;
  si = 0x8000;
  i = si;
  i = 0;
  si = 0x7FFF;
  i = si;
  i = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movw   $0x1,-0xa(%rbp)
movswl -0xa(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movw   $0xffff,-0xa(%rbp)
movswl -0xa(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movw   $0x8000,-0xa(%rbp)
movswl -0xa(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movw   $0x7fff,-0xa(%rbp)
movswl -0xa(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
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
%3 = alloca i16
store i32 0, i32* %1
store i32 0, i32* %2
store i16 1, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
store i32 %5, i32* %2
store i32 0, i32* %2
store i16 -1, i16* %3
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
store i32 %7, i32* %2
store i32 0, i32* %2
store i16 -32768, i16* %3
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
store i32 %9, i32* %2
store i32 0, i32* %2
store i16 32767, i16* %3
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
store i32 %11, i32* %2
store i32 0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int(isxdigit)(int c) { return isxdigit(c); }


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

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

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
ret i32 undef
}
int INHERENT_ptrace() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @INHERENT_ptrace() {
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll63(struct __test_metadata *);
void wrapper_epoll63(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll63(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll63>:
jmp    1030 <epoll63@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll63(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll63(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll63(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll63(%struct.__test_metadata* %0)
ret void
}
void recover_cached_2d_array_point_(double *array, int *dim1, int *dim2, int *i,
                                    int *j, double **pointer_val) {
  double *ptr;
  int index;
  ptr = *pointer_val;
  index = (*j - 1) * *dim1 + (*i - 1);
  array[0] = ptr[index];
  return;
}


x86 assembly (clang, -O0):
<recover_cached_2d_array_point_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<recover_cached_2d_array_point_>:
mov    (%r9),%rax
movslq (%r8),%rdx
add    $0xffffffffffffffff,%rdx
movslq (%rsi),%rsi
imul   %rdx,%rsi
movslq (%rcx),%rcx
add    %rsi,%rcx
movsd  -0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @recover_cached_2d_array_point_(double* %0, i32* %1, i32* %2, i32* %3, i32* %4, double** %5) {
%7 = alloca double*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca double**
%13 = alloca double*
%14 = alloca i32
store double* %0, double** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store double** %5, double*** %12
%15 = load double**, double*** %12
%16 = load double*, double** %15
store double* %16, double** %13
%17 = load i32*, i32** %11
%18 = load i32, i32* %17
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %8
%21 = load i32, i32* %20
%22 = mul nsw i32 %19, %21
%23 = load i32*, i32** %10
%24 = load i32, i32* %23
%25 = sub nsw i32 %24, 1
%26 = add nsw i32 %22, %25
store i32 %26, i32* %14
%27 = load double*, double** %13
%28 = load i32, i32* %14
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %7
%33 = getelementptr inbounds double, double* %32, i64 0
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @recover_cached_2d_array_point_(double* nocapture writeonly %0, i32* nocapture %1, i32* nocapture readnone %2, i32* nocapture %3, i32* nocapture %4, double** nocapture %5) {
%7 = load double*, double** %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
%10 = load i32, i32* %1
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %12, -1
%14 = add nsw i32 %13, %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %7, i64 %15
%17 = load double, double* %16
store double %17, double* %0
ret void
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  for (; *s && *s != c; s++)
    ;
  return (*s == c) ? (char *)s : NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1130 <strchr+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <strchr+0x40>
jmp    1156 <strchr+0x56>
jmp    1145 <strchr+0x45>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1173 <strchr+0x73>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117e <strchr+0x7e>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    117e <strchr+0x7e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %ecx,%ecx
je     1120 <strchr+0x20>
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %19, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %4
%15 = icmp ne i32 %13, %14
br label %16
16: ; preds = %10, %5
%17 = phi i1 [ false, %5 ], [ %15, %10 ]
br i1 %17, label %18, label %22
18: ; preds = %16
br label %19
19: ; preds = %18
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %5
22: ; preds = %16
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i32, i32* %4
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = load i8*, i8** %3
br label %31
30: ; preds = %22
br label %31
31: ; preds = %30, %28
%32 = phi i8* [ %29, %28 ], [ null, %30 ]
ret i8* %32
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = select i1 %8, i8* %4, i8* null
ret i8* %12
}
void ctx_load(void *ctx) {}


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

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

LLVM IR (-O0):
define void @ctx_load(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @ctx_load(i8* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned long get_pbb_clk_rate();
unsigned long get_macb_pclk_rate(unsigned int dev_id) {
  return get_pbb_clk_rate();
}


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

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

LLVM IR (-O0):
define i64 @get_macb_pclk_rate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @get_pbb_clk_rate()
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_macb_pclk_rate(i32 %0) {
%2 = tail call i64 (...) @get_pbb_clk_rate()
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setZeroZero(int *);
int main(void) {
  int a[] = {7, 9, 10, 24, 3};
  printf("Primer elemento del array: %d\n", a[0]);
  setZeroZero(a);
  printf("Luego de correr la funcion el primer elemento es: %d\n", a[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <setZeroZero@plt>
mov    -0x20(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed4(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
call   1040 <setZeroZero@plt>
mov    (%rsp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 7, i32 9, i32 10, i32 24, i32 3]
@.str = [31 x i8] c"Primer elemento del array: %d\0A\00"
@.str.1 = [54 x i8] c"Luego de correr la funcion el primer elemento es: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @setZeroZero(i32* %7)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 7, i32 9, i32 10, i32 24, i32 3]
@.str = [31 x i8] c"Primer elemento del array: %d\0A\00"
@.str.1 = [54 x i8] c"Luego de correr la funcion el primer elemento es: %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = call i32 @setZeroZero(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int test_imm_8Fint64_highword_reg(long long val) {
  return ((val >> 32) & (0x8F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Fint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x8f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Fint64_highword_reg>:
movabs $0x8f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Fint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 143
%6 = icmp ne i64 %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_8Fint64_highword_reg(i64 %0) {
%2 = and i64 %0, 614180323328
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct hda_codec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alc882_gpio_mute(struct hda_codec *, int,
                                    int /*<<< orphan*/);
void alc885_macpro_init_hook(struct hda_codec *codec) {
  alc882_gpio_mute(codec, 0, 0);
  alc882_gpio_mute(codec, 1, 0);
}


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

x86 assembly (clang, -O2):
<alc885_macpro_init_hook>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <alc882_gpio_mute@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <alc882_gpio_mute@plt>

LLVM IR (-O0):
%struct.hda_codec = type { i32 }
define void @alc885_macpro_init_hook(%struct.hda_codec* %0) {
%2 = alloca %struct.hda_codec*
store %struct.hda_codec* %0, %struct.hda_codec** %2
%3 = load %struct.hda_codec*, %struct.hda_codec** %2
%4 = call i32 @alc882_gpio_mute(%struct.hda_codec* %3, i32 0, i32 0)
%5 = load %struct.hda_codec*, %struct.hda_codec** %2
%6 = call i32 @alc882_gpio_mute(%struct.hda_codec* %5, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.hda_codec = type { i32 }
define void @alc885_macpro_init_hook(%struct.hda_codec* %0) {
%2 = tail call i32 @alc882_gpio_mute(%struct.hda_codec* %0, i32 0, i32 0)
%3 = tail call i32 @alc882_gpio_mute(%struct.hda_codec* %0, i32 1, i32 0)
ret void
}
void *lrt_trans_lmem(void) { return (void *)(0xFFFFFFFE00000000ULL); }


x86 assembly (clang, -O0):
<lrt_trans_lmem>:
push   %rbp
mov    %rsp,%rbp
movabs $0xfffffffe00000000,%rax
ff ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrt_trans_lmem>:
movabs $0xfffffffe00000000,%rax
ff ff ff
ret

LLVM IR (-O0):
define i8* @lrt_trans_lmem() {
ret i8* inttoptr (i64 -8589934592 to i8*)
}

LLVM IR (-O2):
define i8* @lrt_trans_lmem() {
ret i8* inttoptr (i64 -8589934592 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ McuSleepC__McuSleep__sleep();
void SchedulerBasicP__McuSleep__sleep(void) { McuSleepC__McuSleep__sleep(); }


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

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

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

LLVM IR (-O2):
define void @SchedulerBasicP__McuSleep__sleep() {
%1 = tail call i32 (...) @McuSleepC__McuSleep__sleep()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int inb(int);
uint32_t fw_cfg_readl_be(void) {
  uint32_t val;
  val = inb(0x511);
  val = (val << 8) | inb(0x511);
  val = (val << 8) | inb(0x511);
  val = (val << 8) | inb(0x511);
  return val;
}


x86 assembly (clang, -O0):
<fw_cfg_readl_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_cfg_readl_be>:
push   %rbp
push   %rbx
push   %rax
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebp
shl    $0x10,%ebx
shl    $0x8,%ebp
or     %ebx,%ebp
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
or     %ebp,%ebx
shl    $0x8,%ebx
mov    $0x511,%edi
call   1030 <inb@plt>
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fw_cfg_readl_be() {
%1 = alloca i32
%2 = call i32 @inb(i32 1297)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 8
%5 = call i32 @inb(i32 1297)
%6 = or i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = shl i32 %7, 8
%9 = call i32 @inb(i32 1297)
%10 = or i32 %8, %9
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = shl i32 %11, 8
%13 = call i32 @inb(i32 1297)
%14 = or i32 %12, %13
store i32 %14, i32* %1
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @fw_cfg_readl_be() {
%1 = tail call i32 @inb(i32 1297)
%2 = tail call i32 @inb(i32 1297)
%3 = shl i32 %1, 16
%4 = shl i32 %2, 8
%5 = or i32 %4, %3
%6 = tail call i32 @inb(i32 1297)
%7 = or i32 %5, %6
%8 = shl i32 %7, 8
%9 = tail call i32 @inb(i32 1297)
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_adress();
int /*<<< orphan*/ set_language();
int /*<<< orphan*/ set_port();
void set_config() {
  printf("Welcome to ConnectedMusicPlayer-Client configuration system.\n");
  set_language();
  set_port();
  set_adress();
}


x86 assembly (clang, -O0):
<set_config>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <set_language@plt>
mov    $0x0,%al
call   1050 <set_port@plt>
mov    $0x0,%al
call   1060 <set_adress@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_config>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <set_language@plt>
xor    %eax,%eax
call   1050 <set_port@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <set_adress@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Welcome to ConnectedMusicPlayer-Client configuration system.\0A\00"
define void @set_config() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @set_language()
%3 = call i32 (...) @set_port()
%4 = call i32 (...) @set_adress()
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"Welcome to ConnectedMusicPlayer-Client configuration system.\00"
define void @set_config() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @set_language()
%3 = tail call i32 (...) @set_port()
%4 = tail call i32 (...) @set_adress()
ret void
}
unsigned hash_value_def(const void *x) {
  unsigned int hash = 1315423911;
  hash ^= ((hash << 5) + (unsigned int)x + (hash >> 2));
  return (hash & 0xFFFFFFF);
}


x86 assembly (clang, -O0):
<hash_value_def>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x4e67c6a7,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_value_def>:
lea    0x92c689(%rdi),%eax
and    $0xfffffff,%eax
xor    $0xe67c6a7,%eax
ret

LLVM IR (-O0):
define i32 @hash_value_def(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1315423911, i32* %3
%4 = load i32, i32* %3
%5 = shl i32 %4, 5
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
%8 = add i32 %5, %7
%9 = load i32, i32* %3
%10 = lshr i32 %9, 2
%11 = add i32 %8, %10
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = and i32 %14, 268435455
ret i32 %15
}

LLVM IR (-O2):
define i32 @hash_value_def(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 9619081
%5 = and i32 %4, 268435455
%6 = xor i32 %5, 241682087
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x6f() {
  Assert_real((isodigit(111) == 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_isodigit.c",
              560, ("isodigit should be 0 for o"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x6f>:
push   %rax
mov    $0x6f,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x230,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for o\00"
define void @t_isodigit_0x6f() {
%1 = call i64 @isodigit(i32 111)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for o\00"
define void @t_isodigit_0x6f() {
%1 = tail call i64 @isodigit(i32 111)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int soma(int x, int y) {
  int c;
  c = x + y;
  return c;
}


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

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

LLVM IR (-O0):
define i32 @soma(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 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @soma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int hash_string_equal(void *s, void *t) {
  return !strcmp((char *)s, (char *)t);
}


x86 assembly (clang, -O0):
<hash_string_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash_string_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @hash_string_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_9Fint16_mem(short *val) {
  return ((*val) & (-0x9F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Fint16_mem>:
movzwl (%rdi),%eax
test   $0xff61,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -159
%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_9Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -159
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ llvm_fcmp_uno(double, double);
int llvm_fcmp_ugt(double X, double Y) { return X > Y || llvm_fcmp_uno(X, Y); }


x86 assembly (clang, -O0):
<llvm_fcmp_ugt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
ja     1150 <llvm_fcmp_ugt+0x40>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <llvm_fcmp_uno@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_fcmp_ugt>:
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     1130 <llvm_fcmp_ugt+0x20>
push   %rax
call   1030 <llvm_fcmp_uno@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_ugt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i64 @llvm_fcmp_uno(double %9, double %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %2
%14 = phi i1 [ true, %2 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @llvm_fcmp_ugt(double %0, double %1) {
%3 = fcmp ogt double %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @llvm_fcmp_uno(double %0, double %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 1, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
bool in_range(const int c, const int min, const int max) {
  return (c >= min && c <= max);
}


x86 assembly (clang, -O0):
<in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <in_range+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_range>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @in_range(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* %4
%8 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @in_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ finalize();
int /*<<< orphan*/ init();
int /*<<< orphan*/ menu();
int main() {
  init();
  menu();
  finalize();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1030 <menu@plt>
mov    $0x0,%al
call   1040 <finalize@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1030 <menu@plt>
xor    %eax,%eax
call   1040 <finalize@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 (...) @menu()
%4 = call i32 (...) @finalize()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @menu()
%3 = tail call i32 (...) @finalize()
ret i32 0
}
/* Variables and functions */
void *x2nrealloc_inline(void *, size_t *, int);
void *x2realloc(void *p, size_t *pn) { return x2nrealloc_inline(p, pn, 1); }


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

x86 assembly (clang, -O2):
<x2realloc>:
mov    $0x1,%edx
jmp    1030 <x2nrealloc_inline@plt>

LLVM IR (-O0):
define i8* @x2realloc(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = load i64*, i64** %4
%7 = call i8* @x2nrealloc_inline(i8* %5, i64* %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
define i8* @x2realloc(i8* %0, i64* %1) {
%3 = tail call i8* @x2nrealloc_inline(i8* %0, i64* %1, i32 1)
ret i8* %3
}
void jpeg_idct_ifast(void) {}


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

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

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

LLVM IR (-O2):
define void @jpeg_idct_ifast() {
ret void
}