xunge/DecIR huggingface dataset:
/* Variables and functions */
double atan2(double, double);
int /*<<< orphan*/ multiply(int, int, int, int, int *, int *);
int phase_change(int ar, int aj, int br, int bj) {
  int cr, cj;
  double angle;
  multiply(ar, aj, br, -bj, &cr, &cj);
  angle = atan2((double)cj, (double)cr);
  angle = angle * (180 / (3.141592653589793));
  return (int)angle;
}


x86 assembly (clang, -O0):
<phase_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1030 <multiply@plt>
cvtsi2sdl -0x18(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe95(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phase_change>:
push   %rax
neg    %ecx
lea    0x4(%rsp),%r8
mov    %rsp,%r9
call   1030 <multiply@plt>
cvtsi2sdl (%rsp),%xmm0
cvtsi2sdl 0x4(%rsp),%xmm1
call   1040 <atan2@plt>
mulsd  0xeb8(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @phase_change(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = sub nsw i32 0, %15
%17 = call i32 @multiply(i32 %12, i32 %13, i32 %14, i32 %16, i32* %9, i32* %10)
%18 = load i32, i32* %10
%19 = sitofp i32 %18 to double
%20 = load i32, i32* %9
%21 = sitofp i32 %20 to double
%22 = call double @atan2(double %19, double %21)
store double %22, double* %11
%23 = load double, double* %11
%24 = fmul double %23, 0x404CA5DC1A63C1F8
store double %24, double* %11
%25 = load double, double* %11
%26 = fptosi double %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @phase_change(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = sub nsw i32 0, %3
%10 = call i32 @multiply(i32 %0, i32 %1, i32 %2, i32 %9, i32* %5, i32* %6)
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
%15 = call double @atan2(double %12, double %14)
%16 = fmul double %15, 0x404CA5DC1A63C1F8
%17 = fptosi double %16 to i32
ret i32 %17
}
/* Variables and functions */
int sam3tcpReceiveEx(int, void *, int, int /*<<< orphan*/);
int sam3tcpReceive(int fd, void *buf, int bufSize) {
  return sam3tcpReceiveEx(fd, buf, bufSize, 0);
}


x86 assembly (clang, -O0):
<sam3tcpReceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <sam3tcpReceiveEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam3tcpReceive>:
xor    %ecx,%ecx
jmp    1030 <sam3tcpReceiveEx@plt>

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

LLVM IR (-O2):
define i32 @sam3tcpReceive(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @sam3tcpReceiveEx(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
char const *path_join(char *, char const *, char *);
int prj_find_package(char const *);
const char *listNonSiblingRefs(const char *name) {
  int i = prj_find_package(name);
  if (i < 0) {
    return path_join("", name, "dll");
  }
  return NULL;
}


x86 assembly (clang, -O0):
<listNonSiblingRefs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <prj_find_package@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1162 <listNonSiblingRefs+0x42>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
lea    0xeac(%rip),%rdx
call   1030 <path_join@plt>
mov    %rax,-0x8(%rbp)
jmp    116a <listNonSiblingRefs+0x4a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listNonSiblingRefs>:
push   %rbx
mov    %rdi,%rbx
call   1040 <prj_find_package@plt>
test   %eax,%eax
js     1131 <listNonSiblingRefs+0x11>
xor    %eax,%eax
pop    %rbx
ret
lea    0xecb(%rip),%rdi
lea    0xec1(%rip),%rdx
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <path_join@plt>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"dll\00"
define i8* @listNonSiblingRefs(i8* %0) {
%2 = tail call i32 @prj_find_package(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @path_join(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test() {
  printf("%s\n", "test");
  return;
}


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

x86 assembly (clang, -O2):
<test>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"test\00"
define void @test() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void caam_debugfs_qi_congested(void) {}


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

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

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

LLVM IR (-O2):
define void @caam_debugfs_qi_congested() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t be16dec(const void *buf) {
  const uint8_t *p = buf;
  return (((uint16_t)p[0]) << 8) | p[1];
}


x86 assembly (clang, -O0):
<be16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be16dec>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @be16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @be16dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ppci_func();
int main() { ppci_func(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @ppci_func()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ppci_func()
ret i32 0
}
void OpenURL(char *url) {}


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

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

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

LLVM IR (-O2):
define void @OpenURL(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
void daemonize() {
  pid_t worker_pid;
  worker_pid = fork();
  if (worker_pid != 0)
    exit(0);
}


x86 assembly (clang, -O0):
<daemonize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <daemonize+0x25>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    112f <daemonize+0xf>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @daemonize() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @daemonize() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
ret void
}
int main() { return 2 != 2; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%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
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *mm_realloc(void *ptr, size_t new_size) { return realloc(ptr, new_size); }


x86 assembly (clang, -O0):
<mm_realloc>:
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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @mm_realloc(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* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @mm_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ message_set_error(int /*<<< orphan*/ *);
int /*<<< orphan*/ message_set_input(int /*<<< orphan*/ *);
int /*<<< orphan*/ message_set_output(int /*<<< orphan*/ *);
void message_init(FILE *output, FILE *error, FILE *input) {
  message_set_output(output);
  message_set_error(error);
  message_set_input(input);
}


x86 assembly (clang, -O0):
<message_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <message_set_output@plt>
mov    -0x10(%rbp),%rdi
call   1050 <message_set_error@plt>
mov    -0x18(%rbp),%rdi
call   1040 <message_set_input@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message_init>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <message_set_output@plt>
mov    %rbx,%rdi
call   1050 <message_set_error@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <message_set_input@plt>

LLVM IR (-O0):
define void @message_init(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 = call i32 @message_set_output(i32* %7)
%9 = load i32*, i32** %5
%10 = call i32 @message_set_error(i32* %9)
%11 = load i32*, i32** %6
%12 = call i32 @message_set_input(i32* %11)
ret void
}

LLVM IR (-O2):
define void @message_init(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @message_set_output(i32* %0)
%5 = tail call i32 @message_set_error(i32* %1)
%6 = tail call i32 @message_set_input(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int array[10];
  int *ptrs[10];
  int i;
  for (i = 0; i < 10; ++i)
    ptrs[i - 1] = &array[i];
  ptrs[0] = &array[9];
  *ptrs[0] = 1;
  array[0] = 2;
  test_assert(array[9] == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x84(%rbp)
cmpl   $0xa,-0x84(%rbp)
jge    116f <main+0x5f>
movslq -0x84(%rbp),%rax
lea    -0x30(%rbp),%rcx
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %rcx,-0x80(%rbp,%rax,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    112c <main+0x1c>
lea    -0x30(%rbp),%rax
add    $0x24,%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x2,-0x30(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32*]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %10
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 %14
store i32* %11, i32** %15
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%21 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 0
store i32* %20, i32** %21
%22 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 0
%23 = load i32*, i32** %22
store i32 1, i32* %23
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 2, i32* %24
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 1
%28 = zext i1 %27 to i32
%29 = call i32 @test_assert(i32 %28)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int gmx_genbox(int, char **);
int main(int argc, char *argv[]) { return gmx_genbox(argc, argv); }


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
mov    -0x10(%rbp),%rsi
call   1030 <gmx_genbox@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_genbox@plt>

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 = load i8**, i8*** %5
%8 = call i32 @gmx_genbox(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_genbox(i32 %0, i8** %1)
ret i32 %3
}
int test_imm_B3int16_mem(short *val) {
  return ((*val) & (0xB3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B3int16_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, 179
%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_B3int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 179
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void __builtin_wasm_prefetch_t(void *);
void prefetch_t(void *p) { return __builtin_wasm_prefetch_t(p); }


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

x86 assembly (clang, -O2):
<prefetch_t>:
jmp    1030 <__builtin_wasm_prefetch_t@plt>

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

LLVM IR (-O2):
define void @prefetch_t(i8* %0) {
tail call void @__builtin_wasm_prefetch_t(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint;

/* Variables and functions */
uint v2p(void *a) { return ((uint)(a)) - 0x80000000; }


x86 assembly (clang, -O0):
<v2p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x80000000,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2p>:
lea    -0x80000000(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @v2p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = sub nsw i64 %4, 2147483648
ret i64 %5
}

LLVM IR (-O2):
define i64 @v2p(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add nsw i64 %2, -2147483648
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void free_uint8_t(uint8_t _val) { return; }


x86 assembly (clang, -O0):
<free_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_uint8_t(i32 %0) {
ret void
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msg_set_bits(struct tipc_msg *, int /*<<< orphan*/, int, int,
                                int);
void msg_set_version(struct tipc_msg *m) { msg_set_bits(m, 0, 29, 7, 2); }


x86 assembly (clang, -O0):
<msg_set_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1d,%edx
mov    $0x7,%ecx
mov    $0x2,%r8d
call   1030 <msg_set_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_set_version>:
xor    %esi,%esi
mov    $0x1d,%edx
mov    $0x7,%ecx
mov    $0x2,%r8d
jmp    1030 <msg_set_bits@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define void @msg_set_version(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i32 @msg_set_bits(%struct.tipc_msg* %3, i32 0, i32 29, i32 7, i32 2)
ret void
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define void @msg_set_version(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_set_bits(%struct.tipc_msg* %0, i32 0, i32 29, i32 7, i32 2)
ret void
}
void XSharpTextExtentsStruct(void *dpy, void *fontSet, void *str, long offset,
                             long count, void *overall_ink_return,
                             void *overall_logical_return) {}


x86 assembly (clang, -O0):
<XSharpTextExtentsStruct>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @XSharpTextExtentsStruct(i8* %0, i8* %1, i8* %2, i64 %3, i64 %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
ret void
}

LLVM IR (-O2):
define void @XSharpTextExtentsStruct(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i64 %3, i64 %4, i8* nocapture %5, i8* nocapture %6) {
ret void
}
int one(const void *intA, const void *intB) {
  return *((int *)intA) < *((int *)intB);
}


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @one(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @one(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ sBuf;

/* Variables and functions */
scalar_t__ atoi(char *);
scalar_t__ osSystem_GetOutput(char *, char *, int);
long osSambaIsEnable(void) {
  char sBuf[16];
  if (osSystem_GetOutput("cat /proc/*[0-9]/stat 2>&- | grep -c '(smbd)'", sBuf,
                         sizeof(sBuf)) <= 0)
    return (-1);
  if (atoi(sBuf) <= 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<osSambaIsEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
lea    0xecd(%rip),%rdi
mov    $0x10,%edx
call   1030 <osSystem_GetOutput@plt>
cmp    $0x0,%rax
jg     1154 <osSambaIsEnable+0x34>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    117c <osSambaIsEnable+0x5c>
lea    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
cmp    $0x0,%rax
jg     1174 <osSambaIsEnable+0x54>
movq   $0x0,-0x8(%rbp)
jmp    117c <osSambaIsEnable+0x5c>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osSambaIsEnable>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <osSystem_GetOutput@plt>
test   %rax,%rax
jle    1155 <osSambaIsEnable+0x35>
mov    %rsp,%rdi
call   1040 <atoi@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
add    $0x18,%rsp
ret
mov    $0xffffffffffffffff,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"cat /proc/*[0-9]/stat 2>&- | grep -c '(smbd)'\00"
define i64 @osSambaIsEnable() {
%1 = alloca i64
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i64 @osSystem_GetOutput(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3, i32 16)
%5 = icmp sle i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i64 -1, i64* %1
br label %13
7: ; preds = %0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%9 = call i64 @atoi(i8* %8)
%10 = icmp sle i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i64 0, i64* %1
br label %13
12: ; preds = %7
store i64 1, i64* %1
br label %13
13: ; preds = %12, %11, %6
%14 = load i64, i64* %1
ret i64 %14
}

LLVM IR (-O2):
@.str = [46 x i8] c"cat /proc/*[0-9]/stat 2>&- | grep -c '(smbd)'\00"
define i64 @osSambaIsEnable() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i64 @osSystem_GetOutput(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2, i32 16)
%4 = icmp slt i64 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = call i64 @atoi(i8* %2)
%7 = icmp sgt i64 %6, 0
%8 = zext i1 %7 to i64
br label %9
9: ; preds = %5, %0
%10 = phi i64 [ -1, %0 ], [ %8, %5 ]
ret i64 %10
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000000))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<CANIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,(%rcx)
ret

LLVM IR (-O0):
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Type definitions */
struct cvmx_shmem_smdr {
  int dummy;
};

/* Variables and functions */
struct cvmx_shmem_smdr *__smdr_init();
struct cvmx_shmem_smdr *cvmx_shmem_init() {
  return __smdr_init();
}


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

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

LLVM IR (-O0):
%struct.cvmx_shmem_smdr = type { i32 }
define %struct.cvmx_shmem_smdr* @cvmx_shmem_init() {
%1 = call %struct.cvmx_shmem_smdr* (...) @__smdr_init()
ret %struct.cvmx_shmem_smdr* %1
}

LLVM IR (-O2):
%struct.cvmx_shmem_smdr = type { i32 }
define %struct.cvmx_shmem_smdr* @cvmx_shmem_init() {
%1 = tail call %struct.cvmx_shmem_smdr* (...) @__smdr_init()
ret %struct.cvmx_shmem_smdr* %1
}
void rop3_60_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T ^ S;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_60_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_60_1_0>:
mov    (%rdi),%al
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_60_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = and i32 %15, %18
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = or i32 %19, %25
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_60_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = and i8 %6, %1
%8 = or i8 %7, %5
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_129() {
  Assert_real((isqrt(129) == 11),
              "/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",
              650, ("Integer square root of 129 should be 11"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_129>:
push   %rax
mov    $0x81,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x28a,%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 = [40 x i8] c"Integer square root of 129 should be 11\00"
define void @t_sqrt_129() {
%1 = call i32 @isqrt(i32 129)
%2 = icmp eq i32 %1, 11
%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 650, i8* getelementptr inbounds ([40 x i8], [40 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 = [40 x i8] c"Integer square root of 129 should be 11\00"
define void @t_sqrt_129() {
%1 = tail call i32 @isqrt(i32 129)
%2 = icmp eq i32 %1, 11
%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 650, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void initSerialReal() {}


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

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

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

LLVM IR (-O2):
define void @initSerialReal() {
ret void
}
int getNextPowerOf2(int value) {
  value--;
  value |= value >> 1;
  value |= value >> 2;
  value |= value >> 4;
  value |= value >> 8;
  value |= value >> 16;
  value++;
  return value;
}


x86 assembly (clang, -O0):
<getNextPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextPowerOf2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getNextPowerOf2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @getNextPowerOf2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
unsigned short my_set_b(void) { return 0x1234; }


x86 assembly (clang, -O0):
<my_set_b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_set_b>:
mov    $0x1234,%ax
ret

LLVM IR (-O0):
define zeroext i16 @my_set_b() {
ret i16 4660
}

LLVM IR (-O2):
define zeroext i16 @my_set_b() {
ret i16 4660
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello, world\n\7"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world\0A\07\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"hello, world\0A\07\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned long long rdmsr(int);
int /*<<< orphan*/ wrmsr(int, unsigned long long);
void apic2_disable(void) {
  wrmsr(0x1b, rdmsr(0x1b) & ~((1ULL << 10) | (1ULL << 11)));
}


x86 assembly (clang, -O0):
<apic2_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <rdmsr@plt>
mov    %rax,%rsi
and    $0xfffffffffffff3ff,%rsi
mov    $0x1b,%edi
call   1040 <wrmsr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apic2_disable>:
push   %rax
mov    $0x1b,%edi
call   1030 <rdmsr@plt>
and    $0xfffffffffffff3ff,%rax
mov    $0x1b,%edi
mov    %rax,%rsi
pop    %rax
jmp    1040 <wrmsr@plt>

LLVM IR (-O0):
define void @apic2_disable() {
%1 = call i64 @rdmsr(i32 27)
%2 = and i64 %1, -3073
%3 = call i32 @wrmsr(i32 27, i64 %2)
ret void
}

LLVM IR (-O2):
define void @apic2_disable() {
%1 = tail call i64 @rdmsr(i32 27)
%2 = and i64 %1, -3073
%3 = tail call i32 @wrmsr(i32 27, i64 %2)
ret void
}
void nbtrace(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @nbtrace(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int strstr(char const *, char const *);
int soru_7(const char s[], const char aranan[]) {
  int x = strstr(s, aranan);
  if (x == 0)
    return -1;
  else
    return x;
}


x86 assembly (clang, -O0):
<soru_7>:
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 <strstr@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1146 <soru_7+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <soru_7+0x3c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_7>:
push   %rax
call   1030 <strstr@plt>
cmp    $0x1,%eax
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @soru_7(i8* %0, i8* %1) {
%3 = tail call i32 @strstr(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
void pci_restore_aer_state(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_restore_aer_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned long long strtoull(char *, char **, int);
unsigned long long getnum(char *str, char **err) {
  char *e;
  unsigned long long rv = strtoull(str, &e, 10);
  if (e == str || *e) {
    *err = str;
    return 0;
  }
  return rv;
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1154 <getnum+0x44>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116c <getnum+0x5c>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1174 <getnum+0x64>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    (%rsp),%rcx
cmp    %rbx,%rcx
je     1135 <getnum+0x25>
cmpb   $0x0,(%rcx)
je     113a <getnum+0x2a>
mov    %rbx,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @getnum(i8* %0, i8** %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i8** %1, i8*** %5
%8 = load i8*, i8** %4
%9 = call i64 @strtoull(i8* %8, i8** %6, i32 10)
store i64 %9, i64* %7
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = icmp eq i8* %10, %11
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13, %2
%19 = load i8*, i8** %4
%20 = load i8**, i8*** %5
store i8* %19, i8** %20
store i64 0, i64* %3
br label %23
21: ; preds = %13
%22 = load i64, i64* %7
store i64 %22, i64* %3
br label %23
23: ; preds = %21, %18
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @getnum(i8* %0, i8** nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtoull(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i8* %0, i8** %1
br label %12
12: ; preds = %8, %11
%13 = phi i64 [ 0, %11 ], [ %5, %8 ]
ret i64 %13
}
void foo_1_1_1_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_2_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ gl_cleanup();
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void gl_error(char *buf) {
  int len = strlen(buf);
  gl_cleanup();
  write(2, buf, len);
  exit(1);
}


x86 assembly (clang, -O0):
<gl_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <gl_cleanup@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<gl_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <gl_cleanup@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define void @gl_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = call i32 (...) @gl_cleanup()
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = call i32 @write(i32 2, i8* %7, i32 %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @gl_error(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 (...) @gl_cleanup()
%4 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i = 0;
  printf("hello world %d\n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"hello world %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void ff_hevc_put_hevc_uni_w_pel_pixels24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels24_12_sse4() {
ret void
}
int main() {
  int p;
  int x1;
  {
    if (p)
      x1 = 0;
    else
      x1 = 2147483647;
  };
  int x2 = x1 + 1;
  int y1 = x2 >> 28;
  return y1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0x0,-0xc(%rbp)
jmp    1128 <main+0x28>
movl   $0x7fffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1c,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xfffffff8,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -8
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M572_f(char *s) {
  debug("M572_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M572_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M572_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M572_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M572_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M572_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M572_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int strcmp(char const *, char const *);
int str_compare(const void *left, const void *right) {
  int result = strcmp((const char *)left, (const char *)right);
  return (result);
}


x86 assembly (clang, -O0):
<str_compare>:
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   1030 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @str_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void smerror_dummy(int prio, char *fmt, ...) {}


x86 assembly (clang, -O0):
<smerror_dummy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @smerror_dummy(i32 %0, i8* nocapture %1, ...) {
ret void
}