xunge/DecIR huggingface dataset:
int logicalShift(int x, int n) {
  int t = 1 << (31 ^ n);
  return ((x >> n) + t) ^ t;
}


x86 assembly (clang, -O0):
<logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
xor    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
add    -0xc(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicalShift>:
mov    %esi,%edx
xor    $0x1f,%dl
mov    $0x1,%eax
mov    %edx,%ecx
shl    %cl,%eax
mov    %esi,%ecx
sar    %cl,%edi
add    %edi,%eax
btc    %edx,%eax
ret

LLVM IR (-O0):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = xor i32 31, %6
%8 = shl i32 1, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = ashr i32 %9, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %5
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = xor i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = ashr i32 %0, %1
%6 = add nsw i32 %4, %5
%7 = xor i32 %6, %4
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_hour(void) {
  time_t t = time(NULL);
  struct tm *lt = localtime(&t);
  return lt->tm_hour;
}


x86 assembly (clang, -O0):
<date_get_hour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_hour>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_hour() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_hour() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int file_exist(const char *filename) {
  FILE *fp;
  fp = fopen(filename, "rb");
  if (fp != NULL) {
    fclose(fp);
    return 1;
  }
  if (errno == ENOENT)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <file_exist+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    118d <file_exist+0x6d>
mov    0x2e79(%rip),%rax
mov    (%rax),%rax
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%rax
jne    1186 <file_exist+0x66>
movl   $0x0,-0x4(%rbp)
jmp    118d <file_exist+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x2e98(%rip),%rax
mov    (%rax),%rcx
mov    0x2e7e(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@errno = global i64 0
@ENOENT = global i64 0
define i32 @file_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %18
12: ; preds = %1
%13 = load i64, i64* @errno
%14 = load i64, i64* @ENOENT
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 0, i32* %2
br label %18
17: ; preds = %12
store i32 1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@errno = global i64 0
@ENOENT = global i64 0
define i32 @file_exist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %11
6: ; preds = %1
%7 = load i64, i64* @errno
%8 = load i64, i64* @ENOENT
%9 = icmp ne i64 %7, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ %10, %6 ]
ret i32 %12
}
void *test_anti_range_54(unsigned n) {
  extern void *alloc_anti_range_54(unsigned) __attribute__((alloc_size(1)));
  if ((0x7fffffff * 2U + 1) - 1 <= n && n <= (0x7fffffff * 2U + 1) - 1)
    n = (0x7fffffff * 2U + 1) - 1 - 1;
  return alloc_anti_range_54(n);
}


x86 assembly (clang, -O0):
<test_anti_range_54>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xfffffffe,%eax
cmp    -0x4(%rbp),%eax
ja     113a <test_anti_range_54+0x2a>
cmpl   $0xfffffffe,-0x4(%rbp)
ja     113a <test_anti_range_54+0x2a>
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_54@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_54>:
cmp    $0xfffffffe,%edi
mov    $0xfffffffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_54@plt>

LLVM IR (-O0):
define i8* @test_anti_range_54(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 -2, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, -2
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -3, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_54(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_54(i32 %0) {
%2 = icmp eq i32 %0, -2
%3 = select i1 %2, i32 -3, i32 %0
%4 = tail call i8* @alloc_anti_range_54(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ tst();
void tst_compare(void) {
  printf("tst_compare: %s\n", tst() > 0 ? "error" : "ok");
}


x86 assembly (clang, -O0):
<tst_compare>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tst@plt>
mov    %rax,%rcx
lea    0xee2(%rip),%rsi
lea    0xed5(%rip),%rax
cmp    $0x0,%rcx
cmovg  %rax,%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_compare>:
push   %rax
xor    %eax,%eax
call   1030 <tst@plt>
test   %rax,%rax
lea    0xedf(%rip),%rax
lea    0xede(%rip),%rsi
cmovg  %rax,%rsi
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"tst_compare: %s\0A\00"
@.str.1 = [6 x i8] c"error\00"
@.str.2 = [3 x i8] c"ok\00"
define void @tst_compare() {
%1 = call i64 (...) @tst()
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"tst_compare: %s\0A\00"
@.str.1 = [6 x i8] c"error\00"
@.str.2 = [3 x i8] c"ok\00"
define void @tst_compare() {
%1 = tail call i64 (...) @tst()
%2 = icmp sgt i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int system(char *);
int createOrEmptyTmpDirectory(const char *output_directory) {
  char *command = malloc(100 * sizeof(char));
  snprintf(command, 100, "rm -rf %s && mkdir %s", output_directory,
           output_directory);
  int result = system(command);
  free(command);
  return result;
}


x86 assembly (clang, -O0):
<createOrEmptyTmpDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x64,%esi
lea    0xe8e(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createOrEmptyTmpDirectory>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xea5(%rip),%rdx
mov    %rax,%rdi
mov    $0x64,%esi
mov    %r14,%rcx
mov    %r14,%r8
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"rm -rf %s && mkdir %s\00"
define i32 @createOrEmptyTmpDirectory(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i8* @malloc(i32 100)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @snprintf(i8* %6, i32 100, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @system(i8* %10)
store i32 %11, i32* %4
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [22 x i8] c"rm -rf %s && mkdir %s\00"
define i32 @createOrEmptyTmpDirectory(i8* %0) {
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%3 = tail call i32 @snprintf(i8* %2, i32 100, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%4 = tail call i32 @system(i8* %2)
%5 = tail call i32 @free(i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ptr;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n = 0;
  int *ptr = &n;
  printf("*ptr is %d byte\n", sizeof(ptr));
  return (EXIT_SUCCESS);
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"*ptr is %d byte\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void child() { printf("i'm child\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"i'm child\00"
define void @child() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srandom(unsigned int);
void srand(unsigned int seed) { srandom(seed); }


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

x86 assembly (clang, -O2):
<srand>:
jmp    1030 <srandom@plt>

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

LLVM IR (-O2):
define void @srand(i32 %0) {
%2 = tail call i32 @srandom(i32 %0)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *buildTree(int *, int /*<<< orphan*/, int);
struct TreeNode *sortedArrayToBST(int *nums, int numsSize) {
  return buildTree(nums, 0, numsSize - 1);
}


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

x86 assembly (clang, -O2):
<sortedArrayToBST>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <buildTree@plt>

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call %struct.TreeNode* @buildTree(i32* %5, i32 0, i32 %7)
ret %struct.TreeNode* %8
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call %struct.TreeNode* @buildTree(i32* %0, i32 0, i32 %3)
ret %struct.TreeNode* %4
}
int test_imm_37uint16_mem(unsigned short *val) {
  return ((*val) & (-0x37 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_37uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -55
%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_37uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -55
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
extern int Parrot_signbit(double x) {
  union {
    double d;
    int i[2];
  } u;
  u.d = x;
  return u.i[1] < 0;
}


x86 assembly (clang, -O0):
<Parrot_signbit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Parrot_signbit>:
movmskpd %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @Parrot_signbit(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to [2 x i32]*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @Parrot_signbit(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
__attribute__((visibility("default"))) void *
sd_bus_get_current_handler(void *bus) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_get_current_handler(i8* nocapture readnone %0) {
ret i8* null
}
void RasterSubPanelEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x38)))) |= (0x80000000u);
}


x86 assembly (clang, -O0):
<RasterSubPanelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x80000000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterSubPanelEnable>:
add    $0x38,%edi
orl    $0x80000000,(%rdi)
ret

LLVM IR (-O0):
define void @RasterSubPanelEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 56
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, -2147483648
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterSubPanelEnable(i32 %0) {
%2 = add i32 %0, 56
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, -2147483648
store volatile i32 %6, i32* %4
ret void
}
int test_imm_17int8_mem(signed char *val) {
  return ((*val) & (0x17 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_17int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 23
%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_17int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 23
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_quit_remove() {}


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

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

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

LLVM IR (-O2):
define void @gtk_quit_remove() {
ret void
}
void next1() {
  asm("#"
      "1");
}


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

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

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

LLVM IR (-O2):
define void @next1() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void foo359(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo359(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ showbits(unsigned int);
int main() {
  unsigned int x = 10;
  ;
  showbits((x >> 1));
  printf("\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @showbits(i32 5)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ connecttoserver();
scalar_t__ getpid();
int /*<<< orphan*/ process();
int /*<<< orphan*/ srand(scalar_t__);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL) + getpid());
  connecttoserver();
  process();
  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   1060 <time@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1050 <srand@plt>
mov    $0x0,%al
call   1070 <connecttoserver@plt>
mov    $0x0,%al
call   1040 <process@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1060 <time@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1050 <srand@plt>
xor    %eax,%eax
call   1070 <connecttoserver@plt>
xor    %eax,%eax
call   1040 <process@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @time(i32* null)
%3 = call i64 (...) @getpid()
%4 = add nsw i64 %2, %3
%5 = call i32 @srand(i64 %4)
%6 = call i32 (...) @connecttoserver()
%7 = call i32 (...) @process()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = tail call i64 (...) @getpid()
%3 = add nsw i64 %2, %1
%4 = tail call i32 @srand(i64 %3)
%5 = tail call i32 (...) @connecttoserver()
%6 = tail call i32 (...) @process()
ret i32 0
}
void osq_unlock(struct optimistic_spin_queue *lock) {}


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

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

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

LLVM IR (-O2):
%struct.optimistic_spin_queue = type opaque
define void @osq_unlock(%struct.optimistic_spin_queue* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
char *quote(char *);
void param_fwritec(FILE *fp, char *var_name, char *val) {
  fprintf(fp, "%s = %s;\n", var_name, quote(val));
}


x86 assembly (clang, -O0):
<param_fwritec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <quote@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_fwritec>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <quote@plt>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s = %s;\0A\00"
define void @param_fwritec(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @quote(i8* %9)
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s = %s;\0A\00"
define void @param_fwritec(i32* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i8* @quote(i8* %2)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
ret void
}
/* Variables and functions */
char *malloc(int);
char *allocate(int size) {
  char *p = malloc(size);
  if (p) {
    for (int i = 0; i < size; i++) {
      p[i] = 0;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <allocate+0x54>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <allocate+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <allocate+0x29>
jmp    1164 <allocate+0x54>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1142 <allocate+0x22>
test   %ebp,%ebp
jle    1142 <allocate+0x22>
mov    %ebp,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @allocate(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp ne i8* %2, null
%4 = icmp sgt i32 %0, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t detexPack32G16(uint32_t g16) {
  return g16 << 16;
}


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

x86 assembly (clang, -O2):
<detexPack32G16>:
mov    %edi,%eax
shl    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @detexPack32G16(i32 %0) {
%2 = shl i32 %0, 16
ret i32 %2
}
int test_imm_D7int64_lowword_reg(long long val) {
  return ((val) & (0xD7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D7int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 215
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ao();
int /*<<< orphan*/ motor(int, int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, World");
  motor(0, 100);
  motor(2, 100);
  msleep(5000);
  ao();
  printf("Hello, kyle");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <motor@plt>
mov    $0x2,%edi
mov    $0x64,%esi
call   1030 <motor@plt>
mov    $0x1388,%edi
call   1040 <msleep@plt>
mov    $0x0,%al
call   1060 <ao@plt>
lea    0xe7f(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <motor@plt>
mov    $0x2,%edi
mov    $0x64,%esi
call   1030 <motor@plt>
mov    $0x1388,%edi
call   1040 <msleep@plt>
xor    %eax,%eax
call   1060 <ao@plt>
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, World\00"
@.str.1 = [12 x i8] c"Hello, kyle\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @motor(i32 0, i32 100)
%4 = call i32 @motor(i32 2, i32 100)
%5 = call i32 @msleep(i32 5000)
%6 = call i32 (...) @ao()
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, World\00"
@.str.1 = [12 x i8] c"Hello, kyle\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @motor(i32 0, i32 100)
%3 = tail call i32 @motor(i32 2, i32 100)
%4 = tail call i32 @msleep(i32 5000)
%5 = tail call i32 (...) @ao()
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void bar(char *str) {
  char buf[4];
  strncpy(buf, str, 4);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @bar(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @bar(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 4)
ret void
}
int Seccomp_exists(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @Seccomp_exists() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Seccomp_exists() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void playgame() { printf("Play game called"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Play game called\00"
define void @playgame() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Play game called\00"
define void @playgame() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((gnu_)) int carmen_imin(int val1, int val2) {
  if (val2 < val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <carmen_imin+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <carmen_imin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_imin>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @carmen_imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int geti();
int /*<<< orphan*/ printf(char *, ...);
int exit() {
  int exitValue;
  printf("enter an exitValue: ");
  exitValue = geti();
  printf("exitvalue=%d\n", exitValue);
  printf("enter kernel to die with exitValue=%d\n", exitValue);
  _exit(exitValue);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <geti@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <geti@plt>
mov    %eax,%ebx
lea    0xec6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"enter an exitValue: \00"
@.str.1 = [14 x i8] c"exitvalue=%d\0A\00"
@.str.2 = [39 x i8] c"enter kernel to die with exitValue=%d\0A\00"
define i32 @exit() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @geti()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @_exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"enter an exitValue: \00"
@.str.1 = [14 x i8] c"exitvalue=%d\0A\00"
@.str.2 = [39 x i8] c"enter kernel to die with exitValue=%d\0A\00"
define i32 @exit() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @geti()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%5 = tail call i32 @_exit(i32 %2)
unreachable
}
int fixed_to_i_round(long int val, int precision) {
  if (precision == 0) {
    return val;
  } else {
    return (val + (1L << (precision - 1))) >> precision;
  }
}


x86 assembly (clang, -O0):
<fixed_to_i_round>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1121 <fixed_to_i_round+0x21>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1144 <fixed_to_i_round+0x44>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
add    %rcx,%rax
mov    -0x14(%rbp),%ecx
sar    %cl,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_to_i_round>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%rax
add    %rdi,%rax
mov    %esi,%ecx
sar    %cl,%rax
cmp    $0x1,%esi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fixed_to_i_round(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i32 %1, -1
%5 = zext i32 %4 to i64
%6 = shl nuw i64 1, %5
%7 = add nsw i64 %6, %0
%8 = zext i32 %1 to i64
%9 = ashr i64 %7, %8
%10 = select i1 %3, i64 %0, i64 %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
int __VERIFIER_nondet_int();
int lt(int, int);
int main() {
  int x = __VERIFIER_nondet_int();
  __VERIFIER_assume(x < 1000);
  int b = lt(x, 1000);
  __VERIFIER_assert(b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
mov    -0x8(%rbp),%edi
mov    $0x3e8,%esi
call   1060 <lt@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0x3e8,%eax
setl   %dil
call   1050 <__VERIFIER_assume@plt>
mov    %ebx,%edi
mov    $0x3e8,%esi
call   1060 <lt@plt>
mov    %eax,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1000
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assume(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @lt(i32 %9, i32 1000)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @__VERIFIER_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 1000
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
%5 = tail call i32 @lt(i32 %1, i32 1000)
%6 = tail call i32 @__VERIFIER_assert(i32 %5)
ret i32 0
}
int setmode(int handle, int mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @setmode(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ _sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
void *list_ipcs() { return (void *)_sys_call(0x61, 0, 0, 0); }


x86 assembly (clang, -O0):
<list_ipcs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <_sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_ipcs>:
mov    $0x61,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_sys_call@plt>

LLVM IR (-O0):
define i8* @list_ipcs() {
%1 = call i64 @_sys_call(i32 97, i32 0, i32 0, i32 0)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @list_ipcs() {
%1 = tail call i64 @_sys_call(i32 97, i32 0, i32 0, i32 0)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert_true_(char *, int, int /*<<< orphan*/);
void test_truth_fail() {
  assert_true_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/"
               "heads/master/test/fail_test.c",
               5, (0));
}


x86 assembly (clang, -O0):
<test_truth_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <assert_true_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_truth_fail>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
xor    %edx,%edx
jmp    1030 <assert_true_@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/fail_test.c\00"
define void @test_truth_fail() {
%1 = call i32 @assert_true_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 5, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/fail_test.c\00"
define void @test_truth_fail() {
%1 = tail call i32 @assert_true_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 5, i32 0)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int lsock;
  struct sockaddr_in sin;
  struct hostent *he;
  lsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  he = gethostbyname("www.freenet6.org");
  exit(0x0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
mov    %eax,-0x8(%rbp)
lea    0xe97(%rip),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
lea    0xea8(%rip),%rdi
call   1030 <gethostbyname@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.hostent = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [17 x i8] c"www.freenet6.org\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.hostent*
store i32 0, i32* %1
%5 = load i32, i32* @AF_INET
%6 = load i32, i32* @SOCK_STREAM
%7 = load i32, i32* @IPPROTO_TCP
%8 = call i32 @socket(i32 %5, i32 %6, i32 %7)
store i32 %8, i32* %2
%9 = call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store %struct.hostent* %9, %struct.hostent** %4
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [17 x i8] c"www.freenet6.org\00"
define i32 @main() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = tail call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
void adapt_vt_ext_close_by_signal(void) {}


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

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

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

LLVM IR (-O2):
define void @adapt_vt_ext_close_by_signal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_http_header(int, int);
int /*<<< orphan*/ write_st(int, char *, char *);
void write_errorpage(int fd, char *buffer) {
  send_http_header(fd, 200);
  write_st(fd, "Unbekannter Request:%s<br>", buffer);
}


x86 assembly (clang, -O0):
<write_errorpage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xc8,%esi
call   1030 <send_http_header@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb6(%rip),%rsi
call   1040 <write_st@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_errorpage>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xc8,%esi
call   1030 <send_http_header@plt>
lea    0xec7(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <write_st@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Unbekannter Request:%s<br>\00"
define void @write_errorpage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @send_http_header(i32 %5, i32 200)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @write_st(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Unbekannter Request:%s<br>\00"
define void @write_errorpage(i32 %0, i8* %1) {
%3 = tail call i32 @send_http_header(i32 %0, i32 200)
%4 = tail call i32 @write_st(i32 %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int);
int shim_userfaultfd(int flags) { return shim_enosys(0, flags); }


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

x86 assembly (clang, -O2):
<shim_userfaultfd>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_userfaultfd(i32 %0) {
%2 = tail call i32 @shim_enosys(i32 0, i32 %0)
ret i32 %2
}