xunge/DecIR huggingface dataset:
unsigned int bit_snoob(unsigned int n) {
  unsigned int smallest, ripple, ones;
  if (n == 0)
    return 0;
  smallest = n & -n;
  ripple = n + smallest;
  ones = n ^ ripple;
  ones = (ones >> 2) / smallest;
  return (ripple | ones);
}


x86 assembly (clang, -O0):
<bit_snoob>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <bit_snoob+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1153 <bit_snoob+0x53>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x2,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_snoob>:
test   %edi,%edi
je     111b <bit_snoob+0x1b>
mov    %edi,%ecx
neg    %ecx
and    %edi,%ecx
lea    (%rcx,%rdi,1),%esi
xor    %esi,%edi
shr    $0x2,%edi
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
or     %esi,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @bit_snoob(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %28
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = sub i32 0, %12
%14 = and i32 %11, %13
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = add i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = xor i32 %18, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = lshr i32 %21, 2
%23 = load i32, i32* %4
%24 = udiv i32 %22, %23
store i32 %24, i32* %6
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = or i32 %25, %26
store i32 %27, i32* %2
br label %28
28: ; preds = %10, %9
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @bit_snoob(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = sub i32 0, %0
%5 = and i32 %4, %0
%6 = add i32 %5, %0
%7 = xor i32 %6, %0
%8 = lshr i32 %7, 2
%9 = udiv i32 %8, %5
%10 = or i32 %9, %6
br label %11
11: ; preds = %1, %3
%12 = phi i32 [ %10, %3 ], [ 0, %1 ]
ret i32 %12
}
/* Type definitions */
struct eapol_sm {
  int dummy;
};
struct eapol_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ os_free(struct eapol_ctx *);
struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx) {
  os_free(ctx);
  return (struct eapol_sm *)1;
}


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

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

LLVM IR (-O0):
%struct.eapol_sm = type { i32 }
%struct.eapol_ctx = type { i32 }
define %struct.eapol_sm* @eapol_sm_init(%struct.eapol_ctx* %0) {
%2 = alloca %struct.eapol_ctx*
store %struct.eapol_ctx* %0, %struct.eapol_ctx** %2
%3 = load %struct.eapol_ctx*, %struct.eapol_ctx** %2
%4 = call i32 @os_free(%struct.eapol_ctx* %3)
ret %struct.eapol_sm* inttoptr (i64 1 to %struct.eapol_sm*)
}

LLVM IR (-O2):
%struct.eapol_sm = type { i32 }
%struct.eapol_ctx = type { i32 }
define %struct.eapol_sm* @eapol_sm_init(%struct.eapol_ctx* %0) {
%2 = tail call i32 @os_free(%struct.eapol_ctx* %0)
ret %struct.eapol_sm* inttoptr (i64 1 to %struct.eapol_sm*)
}
int right(int i) { return (i * 2 + 1); }


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @right(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
double my_scalbn(double, int);
double my_ldexp(double x, int n) { return my_scalbn(x, n); }


x86 assembly (clang, -O0):
<my_ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <my_scalbn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ldexp>:
jmp    1030 <my_scalbn@plt>

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

LLVM IR (-O2):
define double @my_ldexp(double %0, i32 %1) {
%3 = tail call double @my_scalbn(double %0, i32 %1)
ret double %3
}
int dsfmt_get_min_array_size(void) { return ((19937 / 104) * 2); }


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

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

LLVM IR (-O0):
define i32 @dsfmt_get_min_array_size() {
ret i32 382
}

LLVM IR (-O2):
define i32 @dsfmt_get_min_array_size() {
ret i32 382
}
int long_hash(char *word) {
  int i = 1, temp = 42, p;
  while (*word != '\0') {
    p = *word * i;
    temp = p + temp;
    word++;
    i++;
  }
  return temp;
}


x86 assembly (clang, -O0):
<long_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2a,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <long_hash+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <long_hash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_hash>:
mov    (%rdi),%dl
mov    $0x2a,%eax
test   %dl,%dl
je     1124 <long_hash+0x24>
mov    $0x1,%ecx
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <long_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @long_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i8* [ %12, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 42, %1 ]
%8 = phi i32 [ %13, %4 ], [ 1, %1 ]
%9 = sext i8 %5 to i32
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %10, %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = add nuw nsw i32 %8, 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 42, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int do_mknod(char *, char *, char *);
int /*<<< orphan*/ writes(char *);
int main(int argc, char *argv[]) {
  if (argc != 4) {
    writes("usage: mknod path modes devs\n");
    return 1;
  }
  return do_mknod(argv[1], argv[2], argv[3]);
}


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)
cmpl   $0x4,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <writes@plt>
movl   $0x1,-0x4(%rbp)
jmp    1178 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1040 <do_mknod@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x4,%edi
jne    113b <main+0x1b>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rdx
mov    %rax,%rsi
pop    %rax
jmp    1040 <do_mknod@plt>
lea    0xebe(%rip),%rdi
call   1030 <writes@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"usage: mknod path modes devs\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @writes(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %21
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
%20 = call i32 @do_mknod(i8* %13, i8* %16, i8* %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %10, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [30 x i8] c"usage: mknod path modes devs\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @writes(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = tail call i32 @do_mknod(i8* %8, i8* %10, i8* %12)
br label %14
14: ; preds = %6, %4
%15 = phi i32 [ 1, %4 ], [ %13, %6 ]
ret i32 %15
}
int padding_for_int32(const int bytes) { return ((-bytes) & 3); }


x86 assembly (clang, -O0):
<padding_for_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<padding_for_int32>:
mov    %edi,%eax
neg    %eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @padding_for_int32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = and i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @padding_for_int32(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func2();
void func1(void) { func2(); }


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

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

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

LLVM IR (-O2):
define void @func1() {
%1 = tail call i32 (...) @func2()
ret void
}
void prefetch(const void *x) {
  __asm__ __volatile__("prefetchnta (%0)" ::"r"(x));
}


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

x86 assembly (clang, -O2):
<prefetch>:
prefetchnta (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetch(i8* %0) {
tail call void asm sideeffect "prefetchnta ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void load_load_barrier(void) { return; }


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

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

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

LLVM IR (-O2):
define void @load_load_barrier() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void *strdup(char const *);
void *xstrdup(const char *str) {
  void *ret = strdup(str);
  if (!ret)
    errx(1, "Malloc failed");
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xstrdup+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xstrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Malloc failed\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Malloc failed\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ mblen(char *, size_t);
void uninitvar_mblen(void) {
  char *string;
  size_t size;
  (void)mblen(string, size);
}


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

x86 assembly (clang, -O2):
<uninitvar_mblen>:
jmp    1030 <mblen@plt>

LLVM IR (-O0):
define void @uninitvar_mblen() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i8*, i8** %1
%4 = load i64, i64* %2
%5 = call i32 @mblen(i8* %3, i64 %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_mblen() {
%1 = tail call i32 @mblen(i8* undef, i64 undef)
ret void
}
/* Variables and functions */
int bit_population_count(unsigned int);
int bit_pop(unsigned int n) { return bit_population_count(n); }


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

x86 assembly (clang, -O2):
<bit_pop>:
jmp    1030 <bit_population_count@plt>

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

LLVM IR (-O2):
define i32 @bit_pop(i32 %0) {
%2 = tail call i32 @bit_population_count(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mainloop_set_poll_func() {
  printf("NOT IMPLEMENTED:"
         "pa_mainloop_set_poll_func"
         "\n");
}


x86 assembly (clang, -O0):
<pa_mainloop_set_poll_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_mainloop_set_poll_func\0A\00"
define i32 @pa_mainloop_set_poll_func() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_mainloop_set_poll_func\00"
define i32 @pa_mainloop_set_poll_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void ScaleSamples_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleSamples_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ bar();
int main(void) {
  if (bar())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
cmp    $0x0,%rax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bar@plt>
test   %rax,%rax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @bar()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ USBDEVFS_RESETEP;
int doioctl(int /*<<< orphan*/, int *, char *);
int reset_ep(int EndPt) {
  return doioctl(USBDEVFS_RESETEP, &EndPt, "reset_ep");
}


x86 assembly (clang, -O0):
<reset_ep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <doioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_ep>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rdx
lea    0x4(%rsp),%rsi
call   1030 <doioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@USBDEVFS_RESETEP = global i32 0
@.str = [9 x i8] c"reset_ep\00"
define i32 @reset_ep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @USBDEVFS_RESETEP
%4 = call i32 @doioctl(i32 %3, i32* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@USBDEVFS_RESETEP = global i32 0
@.str = [9 x i8] c"reset_ep\00"
define i32 @reset_ep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @USBDEVFS_RESETEP
%4 = call i32 @doioctl(i32 %3, i32* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
unsigned count_parameters(char **components) {
  if (!components)
    return -1;
  unsigned count = 0;
  while (components[count++])
    ;
  return count - 1;
}


x86 assembly (clang, -O0):
<count_parameters>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <count_parameters+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <count_parameters+0x50>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    %ecx,%ecx
cmpq   $0x0,(%rax,%rcx,8)
je     1147 <count_parameters+0x47>
jmp    1126 <count_parameters+0x26>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_parameters>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111a <count_parameters+0x1a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi,%rax,8)
jne    1110 <count_parameters+0x10>
ret

LLVM IR (-O0):
define i32 @count_parameters(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = icmp ne i8** %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 -1, i32* %2
br label %21
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %17, %8
%10 = load i8**, i8*** %3
%11 = load i32, i32* %4
%12 = add i32 %11, 1
store i32 %12, i32* %4
%13 = zext i32 %11 to i64
%14 = getelementptr inbounds i8*, i8** %10, i64 %13
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
%20 = sub i32 %19, 1
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @count_parameters(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ 0, %1 ]
%5 = add i32 %4, 1
%6 = zext i32 %4 to i64
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ -1, %1 ], [ %4, %3 ]
ret i32 %11
}
int test_imm_82uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x82 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_82uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 130
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void Userdef_OSTM1_Int(void) {}


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

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

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

LLVM IR (-O2):
define void @Userdef_OSTM1_Int() {
ret void
}
int index_4d(int a, int b, int c, int d, int length2, int length3,
             int length4) {
  return d + length4 * (c + length3 * (b + length2 * (a)));
}


x86 assembly (clang, -O0):
<index_4d>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%r8d
imul   -0x4(%rbp),%r8d
add    %r8d,%edi
imul   %edi,%esi
add    %esi,%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_4d>:
imul   %r8d,%edi
lea    (%rdi,%rsi,1),%eax
imul   %r9d,%eax
add    %edx,%eax
imul   0x8(%rsp),%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @index_4d(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = mul nsw i32 %4, %0
%9 = add nsw i32 %8, %1
%10 = mul nsw i32 %9, %5
%11 = add nsw i32 %10, %2
%12 = mul nsw i32 %11, %6
%13 = add nsw i32 %12, %3
ret i32 %13
}
int configGetAttributeInt(attribute, value)
char *attribute;
int *value;
{
  char *ptr;
  int ret;
  ret = configGetAttribute(attribute, &ptr);
  if (ret == 0) {
    *value = atoi(ptr);
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<configGetAttributeInt>:
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    $0x0,%al
call   1030 <configGetAttribute@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    116b <configGetAttributeInt+0x4b>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1172 <configGetAttributeInt+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configGetAttributeInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <configGetAttribute@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jne    114f <configGetAttributeInt+0x2f>
mov    0x8(%rsp),%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @configGetAttributeInt(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @configGetAttribute to i32 (i8*, i8**, ...)*)(i8* %0, i8** %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, void const *);
const char *_sl_print(const void *datum) {
  static char buf[1024];
  sprintf(buf, "%p", datum);
  return buf;
}


x86 assembly (clang, -O0):
<_sl_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sl_print>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_sl_print.buf = internal global [1024 x i8] zeroinitializer
@.str = [3 x i8] c"%p\00"
define i8* @_sl_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_sl_print.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_sl_print.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@_sl_print.buf = internal global [1024 x i8] zeroinitializer
@.str = [3 x i8] c"%p\00"
define i8* @_sl_print(i8* %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @_sl_print.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_sl_print.buf, i64 0, i64 0)
}
int free_tokenlist(char **toklist) {
  char **it;
  for (it = toklist; it && *it; ++it) {
    free(*it);
  }
  free(toklist);
  return 0;
}


x86 assembly (clang, -O0):
<free_tokenlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1142 <free_tokenlist+0x32>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1152 <free_tokenlist+0x42>
jmp    116f <free_tokenlist+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <free_tokenlist+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_tokenlist>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1141 <free_tokenlist+0x31>
mov    (%r14),%rdi
test   %rdi,%rdi
je     1141 <free_tokenlist+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_tokenlist+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @free_tokenlist(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3, %1
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret i32 0
}
void hardfault_handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<hardfault_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hardfault_handler+0x9>
jmp    1109 <hardfault_handler+0x9>

x86 assembly (clang, -O2):
<hardfault_handler>:
jmp    1100 <hardfault_handler>

LLVM IR (-O0):
define void @hardfault_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @hardfault_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int autotune_continuation_parameters(int difficulty_level,
                                     int digits_of_precision) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(193, &difficulty_level, &digits_of_precision, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<autotune_continuation_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0xc1,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autotune_continuation_parameters>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0xc1,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @autotune_continuation_parameters(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc(i32 193, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @autotune_continuation_parameters(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc(i32 193, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
int ConnectParams_doSomething(const struct SimpleStruct *const this) {
  return 1;
}


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

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

LLVM IR (-O0):
%struct.SimpleStruct = type opaque
define i32 @ConnectParams_doSomething(%struct.SimpleStruct* %0) {
%2 = alloca %struct.SimpleStruct*
store %struct.SimpleStruct* %0, %struct.SimpleStruct** %2
ret i32 1
}

LLVM IR (-O2):
%struct.SimpleStruct = type opaque
define i32 @ConnectParams_doSomething(%struct.SimpleStruct* nocapture readnone %0) {
ret i32 1
}
void main() {
  int max(int x, int y);
  int (*p)();
  int a = 5, b = 10, c;
  p = max;
  c = (*p)(a, b);
  printf("a=%d,b=%d,max=%d", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   *%rcx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <max@plt>
lea    0xec7(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
mov    %eax,%ecx
xor    %eax,%eax
pop    %r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"a=%d,b=%d,max=%d\00"
define void @main() {
%1 = alloca i32 (...)*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 5, i32* %2
store i32 10, i32* %3
store i32 (...)* bitcast (i32 (i32, i32)* @max to i32 (...)*), i32 (...)** %1
%5 = load i32 (...)*, i32 (...)** %1
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = bitcast i32 (...)* %5 to i32 (i32, i32, ...)*
%9 = call i32 (i32, i32, ...) %8(i32 %6, i32 %7)
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"a=%d,b=%d,max=%d\00"
define void @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (i32, i32)* @max to i32 (i32, i32, ...)*)(i32 5, i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 5, i32 10, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts0(char *);
int puts(char *s) {
  puts0(s);
  puts0("\r\n");
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <puts0@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1030 <puts0@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts0@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @puts0(i8* %4)
%6 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @puts0(i8* %0)
%3 = tail call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int checkpal(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[20];
  scanf("%s", word);
  if (checkpal(word, 0) == 1)
    printf("Yes");
  else
    printf("No");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1040 <checkpal@plt>
cmp    $0x1,%eax
jne    1174 <main+0x44>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x50>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <checkpal@plt>
cmp    $0x1,%eax
lea    0xea8(%rip),%rax
lea    0xea5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"Yes\00"
@.str.2 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @checkpal(i8* %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"Yes\00"
@.str.2 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @checkpal(i8* %2, i32 0)
%5 = icmp eq i32 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
int test_imm_D8int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xD8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D8int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 216
%7 = icmp ne i64 %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_D8int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 927712935936
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ logStart(char *);
int /*<<< orphan*/ sprintf(char *, char *, long);
void logStartA(char *text, long a) {
  char buffer[255];
  sprintf(buffer, text, a);
  logStart(buffer);
}


x86 assembly (clang, -O0):
<logStartA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <logStart@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logStartA>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <logStart@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @logStartA(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [255 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i64 %8)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @logStart(i8* %10)
ret void
}

LLVM IR (-O2):
define void @logStartA(i8* nocapture %0, i64 %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i64 %1)
%6 = call i32 @logStart(i8* %4)
ret void
}
/* Variables and functions */
int openat(int, char const *, int);
__attribute__((__weak__, __always___)) int
softboundmpx_openat(int dirfd, const char *pathname, int flags) {
  return openat(dirfd, pathname, flags);
}


x86 assembly (clang, -O0):
<softboundmpx_openat>:
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
call   1030 <openat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_openat>:
jmp    1030 <openat@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_openat(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 @openat(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundmpx_openat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @openat(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
long long min(long long a, long long b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void X509V3_add1_i2d(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_add1_i2d() {
ret void
}
/* Type definitions */
struct wl_registry {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_registry_get_user_data(struct wl_registry *wl_registry) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_registry);
}


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

x86 assembly (clang, -O2):
<wl_registry_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_registry = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_registry_get_user_data(%struct.wl_registry* %0) {
%2 = alloca %struct.wl_registry*
store %struct.wl_registry* %0, %struct.wl_registry** %2
%3 = load %struct.wl_registry*, %struct.wl_registry** %2
%4 = bitcast %struct.wl_registry* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_registry = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_registry_get_user_data(%struct.wl_registry* %0) {
%2 = bitcast %struct.wl_registry* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
int atoi(char *);
int exact_square(char *num) {
  int finalNumber, numberForRoot;
  finalNumber = atoi(num);
  for (numberForRoot = 2; numberForRoot < finalNumber; numberForRoot++) {
    if (finalNumber == numberForRoot * numberForRoot)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116c <exact_square+0x5c>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
cmp    %ecx,%eax
jne    1159 <exact_square+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1173 <exact_square+0x63>
jmp    115e <exact_square+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <exact_square+0x1f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
push   %rax
call   1030 <atoi@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
jl     1140 <exact_square+0x30>
mov    $0x2,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%esi
imul   %edx,%esi
cmp    %esi,%ecx
je     1142 <exact_square+0x32>
add    $0x1,%edx
cmp    %edx,%ecx
jne    1130 <exact_square+0x20>
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @exact_square(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = icmp sgt i32 %2, 2
br i1 %3, label %6, label %11
4: ; preds = %6
%5 = icmp eq i32 %10, %2
br i1 %5, label %11, label %6
6: ; preds = %1, %4
%7 = phi i32 [ %10, %4 ], [ 2, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %2, %8
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %4
11: ; preds = %6, %4, %1
%12 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %6 ]
ret i32 %12
}