xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __assert(char const *, char const *, int);
scalar_t__ strcmp(char const *, char const *);
void assertstreq_impl(const char *str1, const char *str2, const char *assertion,
                      const char *file, int line, const char *function) {
  if (strcmp(str1, str2) != 0)
    __assert(assertion, file, line);
}


x86 assembly (clang, -O0):
<assertstreq_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1167 <assertstreq_impl+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <__assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertstreq_impl>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %rdx,%rbp
call   1030 <strcmp@plt>
test   %rax,%rax
je     1149 <assertstreq_impl+0x29>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__assert@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @assertstreq_impl(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4, i8* nocapture readnone %5) {
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @__assert(i8* %2, i8* %3, i32 %4)
br label %11
11: ; preds = %9, %6
ret void
}
void echo_off(void) {}


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

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

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

LLVM IR (-O2):
define void @echo_off() {
ret void
}
int isPositive(int x) { return (!(x >> 31)) & (!!x); }


x86 assembly (clang, -O0):
<isPositive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPositive>:
mov    %edi,%ecx
not    %ecx
shr    $0x1f,%ecx
xor    %eax,%eax
test   %edi,%edi
setne  %al
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isPositive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = and i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @isPositive(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = icmp ne i32 %0, 0
%5 = zext i1 %4 to i32
%6 = and i32 %3, %5
ret i32 %6
}
/* Type definitions */
typedef int pthread_key_t;

/* Variables and functions */
int pthread_key_create(pthread_key_t *key, void (*destructor)(void *)) {
  int tld = -1;
  if (tld >= 0) {
    *key = tld;
    return (0);
  } else
    return (-1);
}


x86 assembly (clang, -O0):
<pthread_key_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1132 <pthread_key_create+0x32>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1139 <pthread_key_create+0x39>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_key_create(i32* nocapture readnone %0, void (i8*)* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int DB_PrintString(char *);
int /*<<< orphan*/ myutoa(unsigned long, char *, int);
int DB_PrintUnsigned(unsigned long number, int radix) {
  char string[100];
  int count;
  myutoa(number, &string[0], radix);
  count = DB_PrintString(&string[0]);
  return (count);
}


x86 assembly (clang, -O0):
<DB_PrintUnsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <myutoa@plt>
lea    -0x70(%rbp),%rdi
call   1040 <DB_PrintString@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DB_PrintUnsigned>:
push   %rbx
sub    $0x70,%rsp
mov    %esi,%edx
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <myutoa@plt>
mov    %rbx,%rdi
call   1040 <DB_PrintString@plt>
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @DB_PrintUnsigned(i64 %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @myutoa(i64 %0, i8* %4, i32 %1)
%6 = call i32 @DB_PrintString(i8* %4)
ret i32 %6
}
void *test_anti_range_76(short n) {
  extern void *alloc_anti_range_76(short) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 1)
    n = 1 - 1;
  return alloc_anti_range_76(n);
}


x86 assembly (clang, -O0):
<test_anti_range_76>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_76+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x1,%eax
jg     1143 <test_anti_range_76+0x33>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_76@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_76>:
xor    %eax,%eax
cmp    $0x1,%di
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_76@plt>

LLVM IR (-O0):
define i8* @test_anti_range_76(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 1, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 0, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_76(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_76(i16 signext %0) {
%2 = icmp eq i16 %0, 1
%3 = select i1 %2, i16 0, i16 %0
%4 = tail call i8* @alloc_anti_range_76(i16 signext %3)
ret i8* %4
}
int str_cmp(char *s1, char *s2, int len) {}


x86 assembly (clang, -O0):
<str_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @str_cmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ free32(int /*<<< orphan*/);
int /*<<< orphan*/ ptr_to_vaddr(int /*<<< orphan*/ *);
int /*<<< orphan*/ sem_destroy(int /*<<< orphan*/ *);
void OSSemDel(sem_t *event) {
  if (event) {
    sem_destroy(event);
    free32(ptr_to_vaddr(event));
  }
}


x86 assembly (clang, -O0):
<OSSemDel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <OSSemDel+0x30>
mov    -0x8(%rbp),%rdi
call   1050 <sem_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ptr_to_vaddr@plt>
mov    %eax,%edi
call   1040 <free32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSSemDel>:
test   %rdi,%rdi
je     114e <OSSemDel+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1050 <sem_destroy@plt>
mov    %rbx,%rdi
call   1030 <ptr_to_vaddr@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <free32@plt>
ret

LLVM IR (-O0):
define void @OSSemDel(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @sem_destroy(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @ptr_to_vaddr(i32* %8)
%10 = call i32 @free32(i32 %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @OSSemDel(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @sem_destroy(i32* %0)
%5 = tail call i32 @ptr_to_vaddr(i32* %0)
%6 = tail call i32 @free32(i32 %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int num1, num2;
  printf("Please input two decimals\n");
  scanf("%d %d", &num1, &num2);
  printf("num1(%d) + num2(%d) = %d", num1, num2, num1 + num2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    (%rdx,%rsi,1),%ecx
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please input two decimals\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [25 x i8] c"num1(%d) + num2(%d) = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [25 x i8] c"num1(%d) + num2(%d) = %d\00"
@str = [26 x i8] c"Please input two decimals\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}
int fun1348() { return 1348; }


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

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

LLVM IR (-O0):
define i32 @fun1348() {
ret i32 1348
}

LLVM IR (-O2):
define i32 @fun1348() {
ret i32 1348
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
int main(void) {
  int seconds = time((time_t *)NULL);
  printf("%d\n", (int)time(NULL));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ FAIL(char *);
int /*<<< orphan*/ PASS(char *);
scalar_t__ foo();
int main() {
  if (foo() == 0)
    FAIL("flat-private-extern found wrong bar");
  else
    PASS("flat-private-extern");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
cmp    $0x0,%rax
jne    1161 <main+0x31>
lea    0xea9(%rip),%rdi
call   1050 <FAIL@plt>
jmp    116d <main+0x3d>
lea    0xebc(%rip),%rdi
call   1040 <PASS@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
test   %rax,%rax
je     114b <main+0x1b>
lea    0xee0(%rip),%rdi
call   1040 <PASS@plt>
jmp    1157 <main+0x27>
lea    0xeae(%rip),%rdi
call   1050 <FAIL@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"flat-private-extern found wrong bar\00"
@.str.1 = [20 x i8] c"flat-private-extern\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @FAIL(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @PASS(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [36 x i8] c"flat-private-extern found wrong bar\00"
@.str.1 = [20 x i8] c"flat-private-extern\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @FAIL(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @PASS(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3_free(void *);
void db_free(void *ptr) { sqlite3_free(ptr); }


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

x86 assembly (clang, -O2):
<db_free>:
jmp    1030 <sqlite3_free@plt>

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

LLVM IR (-O2):
define void @db_free(i8* %0) {
%2 = tail call i32 @sqlite3_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ maxHeapify(int *, int, int);
void buildMaxHeap(int array[], int heapSize) {
  int i;
  int iParent;
  iParent = (heapSize - 1) / 2;
  for (i = iParent; i >= 0; i--) {
    maxHeapify(array, iParent, heapSize);
  }
}


x86 assembly (clang, -O0):
<buildMaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     115d <buildMaxHeap+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <maxHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <buildMaxHeap+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildMaxHeap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
js     1152 <buildMaxHeap+0x42>
mov    %esi,%r15d
mov    %rdi,%r14
lea    -0x1(%r15),%eax
shr    $0x1f,%eax
lea    (%r15,%rax,1),%ebx
add    $0xffffffff,%ebx
sar    %ebx
lea    0x1(%rbx),%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   1030 <maxHeapify@plt>
add    $0xffffffff,%ebp
jg     1140 <buildMaxHeap+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @buildMaxHeap(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = icmp sgt i32 %1, -1
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %4, %2 ]
%8 = tail call i32 @maxHeapify(i32* %0, i32 %4, i32 %1)
%9 = add nsw i32 %7, -1
%10 = icmp sgt i32 %7, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
int main0() {
  int *arr2 = (int *)0x04000000;
  int temp = 0;
  *(arr2) = 1;
  for (int i = 0; i <= 100; i++) {
    temp += i;
  }
  *(arr2 + 2) = temp;
  return 0;
}


x86 assembly (clang, -O0):
<main0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000000,%eax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jg     1146 <main0+0x46>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <main0+0x25>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main0>:
movl   $0x1,0x4000000
movl   $0x13ba,0x4000008
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main0() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
store i32* inttoptr (i64 67108864 to i32*), i32** %1
store i32 0, i32* %2
%4 = load i32*, i32** %1
store i32 1, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load i32, i32* %2
%17 = load i32*, i32** %1
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main0() {
store i32 1, i32* inttoptr (i64 67108864 to i32*)
store i32 5050, i32* inttoptr (i64 67108872 to i32*)
ret i32 0
}
/* Type definitions */
typedef int pthread_key_t;

/* Variables and functions */
int pthread_key_create(pthread_key_t *key, void (*__destr_function)(void *)) {
  ;
  static int countKeys = 0;
  *key = countKeys;
  countKeys++;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_key_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2f12(%rip),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2f06(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2efd(%rip)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_key_create>:
mov    0x2f1e(%rip),%eax
mov    %eax,(%rdi)
add    $0x1,%eax
mov    %eax,0x2f13(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@pthread_key_create.countKeys = internal global i32 0
define i32 @pthread_key_create(i32* %0, void (i8*)* %1) {
%3 = alloca i32*
%4 = alloca void (i8*)*
store i32* %0, i32** %3
store void (i8*)* %1, void (i8*)** %4
%5 = load i32, i32* @pthread_key_create.countKeys
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32, i32* @pthread_key_create.countKeys
%8 = add nsw i32 %7, 1
store i32 %8, i32* @pthread_key_create.countKeys
ret i32 0
}

LLVM IR (-O2):
@pthread_key_create.countKeys = internal unnamed_addr global i32 0
define i32 @pthread_key_create(i32* nocapture writeonly %0, void (i8*)* nocapture readnone %1) {
%3 = load i32, i32* @pthread_key_create.countKeys
store i32 %3, i32* %0
%4 = add nsw i32 %3, 1
store i32 %4, i32* @pthread_key_create.countKeys
ret i32 0
}
void or2OR() {}


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

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

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

LLVM IR (-O2):
define void @or2OR() {
ret void
}
int main() {
  unsigned int arg = 0x80000000;
  unsigned int out = 0;
  __asm__("rorl $1, %%eax;" : "=a"(out) : "a"(arg));
  return (out == 0x40000000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
ror    %eax
mov    %eax,-0xc(%rbp)
cmpl   $0x40000000,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x80000000,%eax
ror    %eax
xor    %ecx,%ecx
cmp    $0x40000000,%eax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -2147483648, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "rorl $$1, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1073741824
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "rorl $$1, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 -2147483648)
%2 = icmp eq i32 %1, 1073741824
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double __infer_nondet_double();
double fdim(double x, double y) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<fdim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fdim(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @fdim(double %0, double %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
void cop_reset(void) {
  *(volatile unsigned char *)(0 + 0x3f) = 0x55;
  *(volatile unsigned char *)(0 + 0x3f) = 0xAA;
}


x86 assembly (clang, -O0):
<cop_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f,%eax
movb   $0x55,(%rax)
mov    $0x3f,%eax
movb   $0xaa,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_reset>:
movb   $0x55,0x3f
55
movb   $0xaa,0x3f
aa
ret

LLVM IR (-O0):
define void @cop_reset() {
store volatile i8 85, i8* inttoptr (i64 63 to i8*)
store volatile i8 -86, i8* inttoptr (i64 63 to i8*)
ret void
}

LLVM IR (-O2):
define void @cop_reset() {
store volatile i8 85, i8* inttoptr (i64 63 to i8*)
store volatile i8 -86, i8* inttoptr (i64 63 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ sleep(int);
void sleep_random(void) {
  int sec = rand() % 3;
  printf("Sleep %d sec...\n", sec);
  sleep(sec);
}


x86 assembly (clang, -O0):
<sleep_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_random>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rbx
imul   $0x55555556,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Sleep %d sec...\0A\00"
define void @sleep_random() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 3
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @sleep(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Sleep %d sec...\0A\00"
define void @sleep_random() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 %2)
ret void
}
double long_long_to_double(long long ll) {
  union {
    long long ll;
    double d;
  } c;
  c.ll = ll;
  return c.d;
}


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

x86 assembly (clang, -O2):
<long_long_to_double>:
movq   %rdi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define double @long_long_to_double(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = bitcast %union.anon* %3 to i64*
store i64 %4, i64* %5
%6 = bitcast %union.anon* %3 to double*
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @long_long_to_double(i64 %0) {
%2 = bitcast i64 %0 to double
ret double %2
}
int test_imm_3Buint8_mem(unsigned char *val) {
  return ((*val) & (0x3B << 0)) ? -20 : -40;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @some_funtion() {
ret void
}
char *RCSid() {
  return RCSid("$Id: misc.c,v 1.138.2.15 2013/07/22 22:19:11 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"$Id: misc.c,v 1.138.2.15 2013/07/22 22:19:11 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
double __nv_logb(double);
double logb(double __a) { return __nv_logb(__a); }


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

x86 assembly (clang, -O2):
<logb>:
jmp    1030 <__nv_logb@plt>

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

LLVM IR (-O2):
define double @logb(double %0) {
%2 = tail call double @__nv_logb(double %0)
ret double %2
}
unsigned int left(unsigned int maze) {
  return (maze << 1) & 0b1111011110111101111011110;
}


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

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
and    $0x1ef7bde,%eax
ret

LLVM IR (-O0):
define i32 @left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = and i32 %4, 32472030
ret i32 %5
}

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 32472030
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_read_shadow_stack_metadata_store(char **,
                                                                    int);
double strtod(char const *, char **);
__attribute__((__weak__, __always___)) double
softboundcets_strtod(const char *nptr, char **endptr) {
  double temp = strtod(nptr, endptr);
  if (endptr != NULL) {
    __softboundcets_read_shadow_stack_metadata_store(endptr, 1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<softboundcets_strtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <softboundcets_strtod+0x3b>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <__softboundcets_read_shadow_stack_metadata_store@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_strtod>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <strtod@plt>
test   %rbx,%rbx
je     114b <softboundcets_strtod+0x2b>
mov    %rbx,%rdi
mov    $0x1,%esi
movsd  %xmm0,0x8(%rsp)
call   1040 <__softboundcets_read_shadow_stack_metadata_store@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define weak double @softboundcets_strtod(i8* %0, i8** %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
%4 = icmp eq i8** %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @__softboundcets_read_shadow_stack_metadata_store(i8** %1, i32 1)
br label %7
7: ; preds = %5, %2
ret double %3
}
/* Variables and functions */
int getpagesize();
scalar_t__ posix_memalign(void **, int, int);
void *alloc_pages(int n) {
  int page_size;
  void *p;
  page_size = getpagesize();
  if (posix_memalign(&p, page_size, page_size * n))
    return NULL;
  return p;
}


x86 assembly (clang, -O0):
<alloc_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
imul   -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
call   1040 <posix_memalign@plt>
cmp    $0x0,%rax
je     115f <alloc_pages+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    1167 <alloc_pages+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_pages>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getpagesize@plt>
imul   %eax,%ebp
mov    %rsp,%rdi
mov    %eax,%esi
mov    %ebp,%edx
call   1040 <posix_memalign@plt>
test   %rax,%rax
jne    1146 <alloc_pages+0x26>
mov    (%rsp),%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @alloc_pages(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i32 (...) @getpagesize()
%5 = mul nsw i32 %4, %0
%6 = call i64 @posix_memalign(i8** %2, i32 %4, i32 %5)
%7 = icmp eq i64 %6, 0
%8 = load i8*, i8** %2
%9 = select i1 %7, i8* %8, i8* null
ret i8* %9
}
int test_imm_B8uint16_reg(unsigned short val) {
  return ((val) & (0xB8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B8uint16_reg>:
test   $0xb8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B8uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 184
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void plat_sleep_ms(int ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<plat_sleep_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @plat_sleep_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @plat_sleep_ms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void not_annotated_c_2_2() {}


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

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

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

LLVM IR (-O2):
define void @not_annotated_c_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_alias(char *, char *);
void cmd_alias(const char *pf, char **args) { add_alias(args[0], args[1]); }


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

x86 assembly (clang, -O2):
<cmd_alias>:
mov    (%rsi),%rdi
mov    0x8(%rsi),%rsi
jmp    1030 <add_alias@plt>

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

LLVM IR (-O2):
define void @cmd_alias(i8* nocapture readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @add_alias(i8* %3, i8* %5)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void setbit(uint8_t num[], uint8_t len, uint8_t bit) {
  uint8_t byte = len - 1 - (bit / 8);
  bit = bit % 8;
  if (byte < len)
    num[byte] |= (1 << bit);
}


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <setbit+0x5e>
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
lea    0x7(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
sar    $0x3,%eax
not    %eax
add    %esi,%eax
cmp    %esi,%eax
jge    1124 <setbit+0x24>
and    $0x7,%dl
mov    $0x1,%esi
mov    %edx,%ecx
shl    %cl,%esi
cltq
or     %esi,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @setbit(i32* nocapture %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = sdiv i32 %2, -8
%6 = add i32 %4, %5
%7 = icmp slt i32 %6, %1
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = and i32 %2, 7
%10 = shl nuw nsw i32 1, %9
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
br label %15
15: ; preds = %8, %3
ret void
}
int test_imm_71int8_reg(signed char val) {
  return ((val) & (0x71 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_71int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x71,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_71int8_reg>:
test   $0x71,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_71int8_reg(i8 signext %0) {
%2 = and i8 %0, 113
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ AA_MAX(int /*<<< orphan*/, scalar_t__);
int AA_MIN(int, int);
int aa_cla_dgelsd_smlsiz();
scalar_t__ log2(int);
int aa_cla_dgelsd_nlvl(int m, int n) {
  int minmn = AA_MIN(m, n);
  int smlsiz = aa_cla_dgelsd_smlsiz();
  return (int)AA_MAX(0, 1 + log2(minmn / (1 + smlsiz)));
}


x86 assembly (clang, -O0):
<aa_cla_dgelsd_nlvl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <AA_MIN@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <aa_cla_dgelsd_smlsiz@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <log2@plt>
mov    %rax,%rsi
add    $0x1,%rsi
xor    %edi,%edi
call   1050 <AA_MAX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dgelsd_nlvl>:
push   %rbx
call   1040 <AA_MIN@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <aa_cla_dgelsd_smlsiz@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <log2@plt>
lea    0x1(%rax),%rsi
xor    %edi,%edi
pop    %rbx
jmp    1050 <AA_MAX@plt>

LLVM IR (-O0):
define i32 @aa_cla_dgelsd_nlvl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @AA_MIN(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = call i32 (...) @aa_cla_dgelsd_smlsiz()
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 1, %12
%14 = sdiv i32 %11, %13
%15 = call i64 @log2(i32 %14)
%16 = add nsw i64 1, %15
%17 = call i64 @AA_MAX(i32 0, i64 %16)
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @aa_cla_dgelsd_nlvl(i32 %0, i32 %1) {
%3 = tail call i32 @AA_MIN(i32 %0, i32 %1)
%4 = tail call i32 (...) @aa_cla_dgelsd_smlsiz()
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %3, %5
%7 = tail call i64 @log2(i32 %6)
%8 = add nsw i64 %7, 1
%9 = tail call i64 @AA_MAX(i32 0, i64 %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int int_digit(char c) {
  assert(c >= '0' && c <= '9');
  return c - '0';
}


x86 assembly (clang, -O0):
<int_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     113d <int_digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_digit>:
push   %rbx
mov    %edi,%ebx
lea    -0x30(%rbx),%eax
xor    %edi,%edi
cmp    $0xa,%al
setb   %dil
call   1030 <assert@plt>
add    $0xffffffd0,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @int_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
ret i32 %16
}

LLVM IR (-O2):
define i32 @int_digit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = add nsw i32 %2, -48
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *fileAsString(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(const int argc, const char **argv) {
  FILE *confFile = fopen("../cli/config", "r+");
  char *confFileContents = fileAsString(confFile);
  printf("%s", confFileContents);
  free(confFileContents);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fileAsString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rdi
call   1040 <fileAsString@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"../cli/config\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = call i8* @fileAsString(i32* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %7
%14 = call i32 @free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"../cli/config\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @fileAsString(i32* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = tail call i32 @free(i8* %4)
ret i32 0
}