xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ a_barrier();
int a_ll(int volatile *);
int /*<<< orphan*/ a_post_llsc();
int /*<<< orphan*/ a_sc(int volatile *, int);
int a_cas(volatile int *p, int t, int s) {
  int old;
  a_barrier();
  do
    old = a_ll(p);
  while (old == t && !a_sc(p, s));
  a_post_llsc();
  return old;
}


x86 assembly (clang, -O0):
<a_cas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <a_barrier@plt>
mov    -0x8(%rbp),%rdi
call   1060 <a_ll@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x15(%rbp)
jne    118d <a_cas+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1050 <a_sc@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1159 <a_cas+0x19>
mov    $0x0,%al
call   1030 <a_post_llsc@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <a_barrier@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1060 <a_ll@plt>
cmp    %r14d,%eax
jne    117d <a_cas+0x3d>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <a_sc@plt>
test   %eax,%eax
je     1160 <a_cas+0x20>
jmp    1180 <a_cas+0x40>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <a_post_llsc@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @a_cas(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @a_barrier()
br label %9
9: ; preds = %22, %3
%10 = load i32*, i32** %4
%11 = call i32 @a_ll(i32* %10)
store i32 %11, i32* %7
br label %12
12: ; preds = %9
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i32*, i32** %4
%18 = load i32, i32* %6
%19 = call i32 @a_sc(i32* %17, i32 %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
br label %22
22: ; preds = %16, %12
%23 = phi i1 [ false, %12 ], [ %21, %16 ]
br i1 %23, label %9, label %24
24: ; preds = %22
%25 = call i32 (...) @a_post_llsc()
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @a_cas(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @a_barrier()
br label %5
5: ; preds = %8, %3
%6 = tail call i32 @a_ll(i32* %0)
%7 = icmp eq i32 %6, %1
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @a_sc(i32* %0, i32 %2)
%10 = icmp eq i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %8
%12 = phi i32 [ %6, %5 ], [ %1, %8 ]
%13 = tail call i32 (...) @a_post_llsc()
ret i32 %12
}
/* Type definitions */
typedef unsigned int uint32_t;
typedef unsigned int n;

/* Variables and functions */
void bitmap_set(uint32_t *bitmap, size_t n) {
  bitmap[((n) >> 5)] |= (1U << (31 - ((n)&31)));
}


x86 assembly (clang, -O0):
<bitmap_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
mov    $0x1f,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x5,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_set>:
mov    %esi,%ecx
not    %cl
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%rsi
or     %eax,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @bitmap_set(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 31
%7 = sub i64 31, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 1, %8
%10 = load i32*, i32** %3
%11 = load i64, i64* %4
%12 = lshr i64 %11, 5
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = or i32 %14, %9
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @bitmap_set(i32* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 31
%5 = xor i32 %4, 31
%6 = shl nuw i32 1, %5
%7 = lshr i64 %1, 5
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %6
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [-dhlt] [hosts ...]\n", getprogname());
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s [-dhlt] [hosts ...]\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s [-dhlt] [hosts ...]\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
unsigned int UINTMAX_MAX;
unsigned bit_mask_nf_2(unsigned bits) { return ~(UINTMAX_MAX << bits); }


x86 assembly (clang, -O0):
<bit_mask_nf_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ee2(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_mask_nf_2>:
mov    %edi,%ecx
mov    0x2ee7(%rip),%rax
mov    (%rax),%eax
shl    %cl,%eax
not    %eax
ret

LLVM IR (-O0):
@UINTMAX_MAX = global i32 0
define i32 @bit_mask_nf_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @UINTMAX_MAX
%4 = load i32, i32* %2
%5 = shl i32 %3, %4
%6 = xor i32 %5, -1
ret i32 %6
}

LLVM IR (-O2):
@UINTMAX_MAX = global i32 0
define i32 @bit_mask_nf_2(i32 %0) {
%2 = load i32, i32* @UINTMAX_MAX
%3 = shl i32 %2, %0
%4 = xor i32 %3, -1
ret i32 %4
}
void foo281() {}


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

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

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

LLVM IR (-O2):
define void @foo281() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sqrt(double);
void sqrtByValue(double n) {
  n = sqrt(n);
  printf("square root of input is %f\n", n);
}


x86 assembly (clang, -O0):
<sqrtByValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtByValue>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113a <sqrtByValue+0x1a>
sqrtsd %xmm0,%xmm0
lea    0xecb(%rip),%rdi
jmp    1030 <printf@plt>
push   %rax
call   1040 <sqrt@plt>
add    $0x8,%rsp
lea    0xeb5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"square root of input is %f\0A\00"
define void @sqrtByValue(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double %3)
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %5)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"square root of input is %f\0A\00"
define void @sqrtByValue(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void swap(void *first, void *second, int size) {
  void *temp = (void *)malloc(size);
  memcpy(temp, first, size);
  memcpy(first, second, size);
  memcpy(second, temp, size);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1040 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i32 %17)
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i32, i32* %6
%22 = call i32 @memcpy(i8* %19, i8* %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @malloc(i32 %2)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %2)
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%8 = tail call i32 @memcpy(i8* %1, i8* %5, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ basename(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void pyi_path_basename(char *result, const char *path) {
  char *base = NULL;
  base = (char *)basename((char *)path);
  strcpy(result, base);
}


x86 assembly (clang, -O0):
<pyi_path_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyi_path_basename>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <basename@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @pyi_path_basename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* null, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @basename(i8* %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %5
%11 = call i32 @strcpy(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @pyi_path_basename(i8* %0, i8* %1) {
%3 = tail call i64 @basename(i8* %1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %0, i8* %4)
ret void
}
void foo458(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo458(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void add_reg64_imm32(unsigned int reg64, unsigned int imm32) {
  put8(0x48);
  put8(0x81);
  put8(0xC0 + reg64);
  put32(imm32);
}


x86 assembly (clang, -O0):
<add_reg64_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xc0,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_reg64_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xc0,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @add_reg64_imm32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 72)
%6 = call i32 @put8(i32 129)
%7 = load i32, i32* %3
%8 = add i32 192, %7
%9 = call i32 @put8(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @put32(i32 %10)
ret void
}

LLVM IR (-O2):
define void @add_reg64_imm32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 72)
%4 = tail call i32 @put8(i32 129)
%5 = add i32 %0, 192
%6 = tail call i32 @put8(i32 %5)
%7 = tail call i32 @put32(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void samba_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<samba_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @samba_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *s) {
  int l = strlen(s) + 1;
  char *d = malloc(l);
  if (d)
    memcpy(d, s, l);
  return d;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <strdup+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <strdup+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
unsigned long edf_maxdatachains(void) { return (20); }


x86 assembly (clang, -O0):
<edf_maxdatachains>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @edf_maxdatachains() {
ret i64 20
}

LLVM IR (-O2):
define i64 @edf_maxdatachains() {
ret i64 20
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(char *, char const *, char const *, int /*<<< orphan*/);
char *strerror(int /*<<< orphan*/);
void aargh(const char *cause) {
  const char *why = strerror(errno);
  if (!why)
    why = "Unknown error";
  msg("%s: %s (%d)", cause, why, errno);
  exit(1);
}


x86 assembly (clang, -O0):
<aargh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <aargh+0x34>
lea    0xea0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2e6d(%rip),%rax
mov    (%rax),%ecx
lea    0xe92(%rip),%rdi
call   1050 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<aargh>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%edi
call   1040 <strerror@plt>
test   %rax,%rax
lea    0xeb0(%rip),%rdx
cmovne %rax,%rdx
mov    (%r14),%ecx
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1050 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [14 x i8] c"Unknown error\00"
@.str.1 = [12 x i8] c"%s: %s (%d)\00"
define void @aargh(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = load i32, i32* @errno
%13 = call i32 @msg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [14 x i8] c"Unknown error\00"
@.str.1 = [12 x i8] c"%s: %s (%d)\00"
define void @aargh(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3
%6 = load i32, i32* @errno
%7 = tail call i32 @msg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %5, i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
}
void wifi_rsp_sme_set_ap_max_clients(
    const struct wifi_msg_sme_set_ap_max_clients_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_set_ap_max_clients_rsp_t = type opaque
define void @wifi_rsp_sme_set_ap_max_clients(%struct.wifi_msg_sme_set_ap_max_clients_rsp_t* nocapture %0) {
ret void
}
void initLinenoiseLine(struct current *current) {}


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

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

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

LLVM IR (-O2):
%struct.current = type opaque
define void @initLinenoiseLine(%struct.current* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mdelay(unsigned long msecs) {
  while (msecs--)
    udelay(1000);
}


x86 assembly (clang, -O0):
<mdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1144 <mdelay+0x34>
mov    $0x3e8,%edi
call   1030 <udelay@plt>
jmp    111c <mdelay+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdelay>:
push   %rbx
test   %rdi,%rdi
je     1130 <mdelay+0x20>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x3e8,%edi
call   1030 <udelay@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <mdelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @mdelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load i64, i64* %2
%5 = add i64 %4, -1
store i64 %5, i64* %2
%6 = icmp ne i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @udelay(i32 1000)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @mdelay(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ %0, %1 ]
%5 = add i64 %4, -1
%6 = tail call i32 @udelay(i32 1000)
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int bot1(int grid[6][7], int move) {}


x86 assembly (clang, -O0):
<bot1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bot1([7 x i32]* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [7 x i32]*
%5 = alloca i32
store [7 x i32]* %0, [7 x i32]** %4
store i32 %1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bot1([7 x i32]* nocapture readnone %0, i32 %1) {
ret i32 undef
}
int ffuser(struct gaufb *ufb, struct gafunc *pfc, struct gastat *pst) {
  return (0);
}


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

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

LLVM IR (-O0):
%struct.gaufb = type opaque
%struct.gafunc = type opaque
%struct.gastat = type opaque
define i32 @ffuser(%struct.gaufb* %0, %struct.gafunc* %1, %struct.gastat* %2) {
%4 = alloca %struct.gaufb*
%5 = alloca %struct.gafunc*
%6 = alloca %struct.gastat*
store %struct.gaufb* %0, %struct.gaufb** %4
store %struct.gafunc* %1, %struct.gafunc** %5
store %struct.gastat* %2, %struct.gastat** %6
ret i32 0
}

LLVM IR (-O2):
%struct.gaufb = type opaque
%struct.gafunc = type opaque
%struct.gastat = type opaque
define i32 @ffuser(%struct.gaufb* nocapture readnone %0, %struct.gafunc* nocapture readnone %1, %struct.gastat* nocapture readnone %2) {
ret i32 0
}
void foo687(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo687(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int detail;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_detail(void *_p, int _v) {
  ((XLeaveWindowEvent *)_p)->detail = (int)_v;
}


x86 assembly (clang, -O0):
<set_XLeaveWindowEvent_detail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XLeaveWindowEvent_detail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_detail(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void RTAvlUIntPtrRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlUIntPtrRemove() {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int *data, int low, int high) {
  int mid;
  if (low < high) {
    mid = partition(data, low, high);
    quickSort(data, low, mid);
    quickSort(data, mid + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1171 <quickSort+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1165 <quickSort+0x45>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <quickSort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
tail call void @quickSort(i32* %0, i32 %6, i32 %7)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %8, %2
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int getpid();
int f3(int i) { return getpid() + i; }


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

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = add nsw i32 %2, %0
ret i32 %3
}
int(ars_d_set_ipopt_sid)(struct ars_packet *pkt, int layer, char *f, char *v) {
  return 0;
}


x86 assembly (clang, -O0):
<ars_d_set_ipopt_sid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_sid(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_sid(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int exist(char *name) {
  struct stat buffer;
  return (stat(name, &buffer) == 0);
}


x86 assembly (clang, -O0):
<exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @exist(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int hash(int pgno) { return pgno % 113; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x71,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movslq %edi,%rax
imul   $0x487ede05,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x71,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = srem i32 %0, 113
ret i32 %2
}
void gtk_progress_bar_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_progress_bar_get_type() {
ret void
}
/* Variables and functions */
double fb_urandom_probability();
double fb_rand_src_urandom(unsigned short *xi) {
  return fb_urandom_probability();
}


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

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

LLVM IR (-O0):
define double @fb_rand_src_urandom(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = call double (...) @fb_urandom_probability()
ret double %3
}

LLVM IR (-O2):
define double @fb_rand_src_urandom(i16* nocapture readnone %0) {
%2 = tail call double (...) @fb_urandom_probability()
ret double %2
}
unsigned int get_k_i(unsigned long M[][156], unsigned long k, unsigned long i) {
  unsigned long I = i / 64;
  unsigned long n_shift = 64 - ((i % 64) + 1);
  return (M[k][I] >> n_shift) & 1;
}


x86 assembly (clang, -O0):
<get_k_i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
and    $0x3f,%rcx
add    $0x1,%rcx
mov    $0x40,%eax
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x4e0,-0x10(%rbp),%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x28(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_k_i>:
mov    %rdx,%rcx
mov    %rdx,%rax
shr    $0x6,%rax
imul   $0x4e0,%rsi,%rdx
add    %rdi,%rdx
mov    (%rdx,%rax,8),%rax
not    %cl
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_k_i([156 x i64]* %0, i64 %1, i64 %2) {
%4 = alloca [156 x i64]*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store [156 x i64]* %0, [156 x i64]** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = udiv i64 %9, 64
store i64 %10, i64* %7
%11 = load i64, i64* %6
%12 = urem i64 %11, 64
%13 = add i64 %12, 1
%14 = sub i64 64, %13
store i64 %14, i64* %8
%15 = load [156 x i64]*, [156 x i64]** %4
%16 = load i64, i64* %5
%17 = getelementptr inbounds [156 x i64], [156 x i64]* %15, i64 %16
%18 = load i64, i64* %7
%19 = getelementptr inbounds [156 x i64], [156 x i64]* %17, i64 0, i64 %18
%20 = load i64, i64* %19
%21 = load i64, i64* %8
%22 = lshr i64 %20, %21
%23 = and i64 %22, 1
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @get_k_i([156 x i64]* nocapture %0, i64 %1, i64 %2) {
%4 = lshr i64 %2, 6
%5 = and i64 %2, 63
%6 = xor i64 %5, 63
%7 = getelementptr inbounds [156 x i64], [156 x i64]* %0, i64 %1, i64 %4
%8 = load i64, i64* %7
%9 = lshr i64 %8, %6
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 1
ret i32 %11
}
/* Variables and functions */
scalar_t__ random(int);
float uniform_rand() { return ((float)(random(32766)) / 32767.0); }


x86 assembly (clang, -O0):
<uniform_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7ffe,%edi
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform_rand>:
push   %rax
mov    $0x7ffe,%edi
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
divss  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @uniform_rand() {
%1 = call i64 @random(i32 32766)
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fdiv double %3, 3.276700e+04
%5 = fptrunc double %4 to float
ret float %5
}

LLVM IR (-O2):
define float @uniform_rand() {
%1 = tail call i64 @random(i32 32766)
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 3.276700e+04
ret float %3
}
__attribute__((always_)) int lookup_module_symbol_name(unsigned long addr,
                                                       char *symname) {
  return -34;
}


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

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

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

LLVM IR (-O2):
define i32 @lookup_module_symbol_name(i64 %0, i8* nocapture readnone %1) {
ret i32 -34
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vpicx_set_intradc(uint8_t *p_mp2vpicx, uint8_t i_intradc) {
  p_mp2vpicx[6] &= 0xf3;
  p_mp2vpicx[6] |= (i_intradc << 2) & 0xc;
}


x86 assembly (clang, -O0):
<mp2vpicx_set_intradc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0xf3,%ecx
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
and    $0xc,%ecx
mov    -0x8(%rbp),%rax
or     0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_set_intradc>:
mov    $0xf3,%eax
and    0x18(%rdi),%eax
and    $0x3,%esi
lea    (%rax,%rsi,4),%eax
mov    %eax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @mp2vpicx_set_intradc(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 6
%7 = load i32, i32* %6
%8 = and i32 %7, 243
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 2
%11 = and i32 %10, 12
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 6
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @mp2vpicx_set_intradc(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
%4 = load i32, i32* %3
%5 = and i32 %4, 243
%6 = shl i32 %1, 2
%7 = and i32 %6, 12
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
void charClassSet(unsigned char bits[], int c) {
  bits[c >> 3] |= (1 << (c & 7));
}


x86 assembly (clang, -O0):
<charClassSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<charClassSet>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x3,%esi
movslq %esi,%rcx
or     %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @charClassSet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 7
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %14, %7
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
ret void
}

LLVM IR (-O2):
define void @charClassSet(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = ashr i32 %1, 3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
int LinearArraySearch(int arr[], int arrlen, int value) {
  int i;
  for (i = 0; i < arrlen; ++i)
    if (arr[i] == value)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<LinearArraySearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <LinearArraySearch+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <LinearArraySearch+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <LinearArraySearch+0x5a>
jmp    1145 <LinearArraySearch+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <LinearArraySearch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LinearArraySearch>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <LinearArraySearch+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <LinearArraySearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <LinearArraySearch+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @LinearArraySearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void gtk_text_iter_backward_word_start() {}


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

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

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

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

/* Variables and functions */
uint32_t fe(uint32_t i) {
  uint32_t o;
  unsigned char *c = (unsigned char *)&i;
  unsigned char *p = (unsigned char *)&o;
  p[0] = c[3];
  p[1] = c[2];
  p[2] = c[1];
  p[3] = c[0];
  return o;
}


x86 assembly (clang, -O0):
<fe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fe(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int recursive_obeb(int x, int y, int bol) {
  return ((x % bol == 0) && (y % bol == 0)) ? bol
                                            : recursive_obeb(x, y, bol - 1);
}


x86 assembly (clang, -O0):
<recursive_obeb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <recursive_obeb+0x3c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <recursive_obeb+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <recursive_obeb+0x50>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <recursive_obeb@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_obeb>:
mov    %edx,%ecx
jmp    1113 <recursive_obeb+0x13>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <recursive_obeb+0x10>
mov    %esi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <recursive_obeb+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @recursive_obeb(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* %6
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i32, i32* %6
br label %24
18: ; preds = %11, %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
%23 = call i32 @recursive_obeb(i32 %19, i32 %20, i32 %22)
br label %24
24: ; preds = %18, %16
%25 = phi i32 [ %17, %16 ], [ %23, %18 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @recursive_obeb(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %11, %3
%5 = phi i32 [ %2, %3 ], [ %12, %11 ]
%6 = srem i32 %0, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = srem i32 %1, %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8, %4
%12 = add nsw i32 %5, -1
br label %4
13: ; preds = %8
ret i32 %5
}
/* Type definitions */
struct foo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print(struct foo *);
int main() {
  struct foo *a;
  print(a);
}


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

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

LLVM IR (-O0):
%struct.foo = type { i32 }
define i32 @main() {
%1 = alloca %struct.foo*
%2 = load %struct.foo*, %struct.foo** %1
%3 = call i32 @print(%struct.foo* %2)
ret i32 0
}

LLVM IR (-O2):
%struct.foo = type { i32 }
define i32 @main() {
%1 = tail call i32 @print(%struct.foo* undef)
ret i32 0
}