xunge/DecIR huggingface dataset:
void acpi_init_lpit(void) {}


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

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

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

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

/* Variables and functions */
int SQLITE_IOERR_SHMMAP;
int memShmMap(sqlite3_file *pFile, int iPg, int pgsz, int bExtend,
              void volatile **pp) {
  return SQLITE_IOERR_SHMMAP;
}


x86 assembly (clang, -O0):
<memShmMap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memShmMap>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SQLITE_IOERR_SHMMAP = global i32 0
define i32 @memShmMap(i32* %0, i32 %1, i32 %2, i32 %3, i8** %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8** %4, i8*** %10
%11 = load i32, i32* @SQLITE_IOERR_SHMMAP
ret i32 %11
}

LLVM IR (-O2):
@SQLITE_IOERR_SHMMAP = global i32 0
define i32 @memShmMap(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i8** nocapture readnone %4) {
%6 = load i32, i32* @SQLITE_IOERR_SHMMAP
ret i32 %6
}
void foo043(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo043(i32 %0) {
ret void
}
char *krad_ebml_version() { return "2.1"; }


x86 assembly (clang, -O0):
<krad_ebml_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<krad_ebml_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"2.1\00"
define i8* @krad_ebml_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"2.1\00"
define i8* @krad_ebml_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int value(char c) {
  if (c == 'P')
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x50,%eax
jne    1123 <value+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <value+0x2a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<value>:
xor    %eax,%eax
cmp    $0x50,%dil
sete   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @value(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 80
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @value(i8 signext %0) {
%2 = icmp eq i8 %0, 80
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("pr19553c\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"pr19553c\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
char *find(char *from, char *upto, char c) {
  char *x = from;
  while (*x != c && x < upto) {
    ++x;
  }
  return x < upto ? x : 0;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x11(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x21(%rbp)
je     113f <find+0x3f>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    114f <find+0x4f>
jmp    1160 <find+0x60>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <find+0x19>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117b <find+0x7b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1186 <find+0x86>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    1186 <find+0x86>
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    %rdi,%rcx
add    $0x1,%rdi
cmp    %rsi,%rcx
jae    1110 <find+0x10>
cmp    %dl,(%rcx)
jne    1100 <find>
add    $0xffffffffffffffff,%rdi
xor    %eax,%eax
cmp    %rsi,%rcx
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @find(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
br label %9
9: ; preds = %22, %3
%10 = load i8*, i8** %7
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %20
16: ; preds = %9
%17 = load i8*, i8** %7
%18 = load i8*, i8** %5
%19 = icmp ult i8* %17, %18
br label %20
20: ; preds = %16, %9
%21 = phi i1 [ false, %9 ], [ %19, %16 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i8*, i8** %7
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %7
br label %9
25: ; preds = %20
%26 = load i8*, i8** %7
%27 = load i8*, i8** %5
%28 = icmp ult i8* %26, %27
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = load i8*, i8** %7
br label %32
31: ; preds = %25
br label %32
32: ; preds = %31, %29
%33 = phi i8* [ %30, %29 ], [ null, %31 ]
ret i8* %33
}

LLVM IR (-O2):
define i8* @find(i8* %0, i8* readnone %1, i8 signext %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %0, %3 ], [ %10, %4 ]
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, %2
%8 = icmp ult i8* %5, %1
%9 = and i1 %8, %7
%10 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %9, label %4, label %11
11: ; preds = %4
%12 = select i1 %8, i8* %5, i8* null
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint8_t downcast_u8(uint64_t x) {
  uint8_t y = (uint8_t)x;
  return y;
}


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

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

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

LLVM IR (-O2):
define i32 @downcast_u8(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef float uint64_t;

/* Variables and functions */
float instantaneousFps(uint64_t duration) {
  if (duration == 0) {
    return 0.0f;
  }
  return (1000.0f * 1000.0f * 1000.0f / duration);
}


x86 assembly (clang, -O0):
<instantaneousFps>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112d <instantaneousFps+0x2d>
jp     112d <instantaneousFps+0x2d>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113f <instantaneousFps+0x3f>
movss  0xecb(%rip),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<instantaneousFps>:
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    110e <instantaneousFps+0xe>
jp     110e <instantaneousFps+0xe>
ret
movss  0xeea(%rip),%xmm0
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @instantaneousFps(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oeq float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = fdiv float 1.000000e+09, %8
store float %9, float* %2
br label %10
10: ; preds = %7, %6
%11 = load float, float* %2
ret float %11
}

LLVM IR (-O2):
define float @instantaneousFps(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
%3 = fdiv float 1.000000e+09, %0
%4 = select i1 %2, float 0.000000e+00, float %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void displayArray(int *array, int count) {
  for (int tabIndex = 0; tabIndex < count; ++tabIndex) {
    printf("array[%d] = %d\n", tabIndex, array[tabIndex]);
  }
}


x86 assembly (clang, -O0):
<displayArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <displayArray+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <displayArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <displayArray+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <displayArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"array[%d] = %d\0A\00"
define void @displayArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"array[%d] = %d\0A\00"
define void @displayArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ check(void *, int /*<<< orphan*/, char *, char const *);
void __is_null(void *context, const char *desc, const void *subject) {
  check(context, subject != NULL, "%s is not NULL", desc);
}


x86 assembly (clang, -O0):
<__is_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rcx
lea    0xec0(%rip),%rdx
call   1030 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__is_null>:
mov    %rsi,%rcx
xor    %esi,%esi
test   %rdx,%rdx
setne  %sil
lea    0xedd(%rip),%rdx
jmp    1030 <check@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s is not NULL\00"
define void @__is_null(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
%10 = zext i1 %9 to i32
%11 = load i8*, i8** %5
%12 = call i32 @check(i8* %7, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s is not NULL\00"
define void @__is_null(i8* %0, i8* %1, i8* readnone %2) {
%4 = icmp ne i8* %2, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @check(i8* %0, i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
FILE *file_open(const char *path) { return fopen(path, "r"); }


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

x86 assembly (clang, -O2):
<file_open>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @file_open(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ str_splt_ws(char *, char **, int, int *);
void parse_input(char *line, char **args, int n, int *argc) {
  str_splt_ws(line, args, n, argc);
}


x86 assembly (clang, -O0):
<parse_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <str_splt_ws@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_input>:
jmp    1030 <str_splt_ws@plt>

LLVM IR (-O0):
define void @parse_input(i8* %0, i8** %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @str_splt_ws(i8* %9, i8** %10, i32 %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @parse_input(i8* %0, i8** %1, i32 %2, i32* %3) {
%5 = tail call i32 @str_splt_ws(i8* %0, i8** %1, i32 %2, i32* %3)
ret void
}
int mumps_convert_2fint_to_longlong(int *short_int1, int *short_int2,
                                    long long *long_int) {
  *long_int = ((long long)(*short_int1) * ((long long)1073741824)) +
              (long long)(*short_int2);
  return 0;
}


x86 assembly (clang, -O0):
<mumps_convert_2fint_to_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
shl    $0x1e,%rcx
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
add    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mumps_convert_2fint_to_longlong>:
movslq (%rdi),%rax
shl    $0x1e,%rax
movslq (%rsi),%rcx
add    %rax,%rcx
mov    %rcx,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mumps_convert_2fint_to_longlong(i32* %0, i32* %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64* %2, i64** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %9, 1073741824
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %10, %13
%15 = load i64*, i64** %6
store i64 %14, i64* %15
ret i32 0
}

LLVM IR (-O2):
define i32 @mumps_convert_2fint_to_longlong(i32* nocapture %0, i32* nocapture %1, i64* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 30
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
store i64 %9, i64* %2
ret i32 0
}
void ff_hevc_put_hevc_uni_qpel_v8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v8_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mp_hal_delay_ms(int);
int mp_hal_rs485_getChar();
int /*<<< orphan*/ mp_hal_rs485_resetRxPacket();
int /*<<< orphan*/ mp_hal_rs485_setConfig(int, int, int /*<<< orphan*/);
void test485UartSetup(void) {
  mp_hal_rs485_setConfig(9600, 1, 0);
  mp_hal_delay_ms(250);
  while (mp_hal_rs485_getChar() != -1)
    mp_hal_delay_ms(2);
  mp_hal_rs485_resetRxPacket();
  mp_hal_delay_ms(250);
}


x86 assembly (clang, -O0):
<test485UartSetup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2580,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <mp_hal_rs485_setConfig@plt>
mov    $0xfa,%edi
call   1050 <mp_hal_delay_ms@plt>
mov    $0x0,%al
call   1030 <mp_hal_rs485_getChar@plt>
cmp    $0xffffffff,%eax
je     117e <test485UartSetup+0x3e>
mov    $0x2,%edi
call   1050 <mp_hal_delay_ms@plt>
jmp    115f <test485UartSetup+0x1f>
mov    $0x0,%al
call   1060 <mp_hal_rs485_resetRxPacket@plt>
mov    $0xfa,%edi
call   1050 <mp_hal_delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test485UartSetup>:
push   %rax
mov    $0x2580,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <mp_hal_rs485_setConfig@plt>
mov    $0xfa,%edi
nopw   0x0(%rax,%rax,1)
call   1050 <mp_hal_delay_ms@plt>
xor    %eax,%eax
call   1030 <mp_hal_rs485_getChar@plt>
cmp    $0xffffffff,%eax
je     1178 <test485UartSetup+0x38>
mov    $0x2,%edi
jmp    1160 <test485UartSetup+0x20>
xor    %eax,%eax
call   1060 <mp_hal_rs485_resetRxPacket@plt>
mov    $0xfa,%edi
pop    %rax
jmp    1050 <mp_hal_delay_ms@plt>

LLVM IR (-O0):
define void @test485UartSetup() {
%1 = call i32 @mp_hal_rs485_setConfig(i32 9600, i32 1, i32 0)
%2 = call i32 @mp_hal_delay_ms(i32 250)
br label %3
3: ; preds = %6, %0
%4 = call i32 (...) @mp_hal_rs485_getChar()
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @mp_hal_delay_ms(i32 2)
br label %3
8: ; preds = %3
%9 = call i32 (...) @mp_hal_rs485_resetRxPacket()
%10 = call i32 @mp_hal_delay_ms(i32 250)
ret void
}

LLVM IR (-O2):
define void @test485UartSetup() {
%1 = tail call i32 @mp_hal_rs485_setConfig(i32 9600, i32 1, i32 0)
%2 = tail call i32 @mp_hal_delay_ms(i32 250)
%3 = tail call i32 (...) @mp_hal_rs485_getChar()
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = tail call i32 @mp_hal_delay_ms(i32 2)
%7 = tail call i32 (...) @mp_hal_rs485_getChar()
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %5
9: ; preds = %5, %0
%10 = tail call i32 (...) @mp_hal_rs485_resetRxPacket()
%11 = tail call i32 @mp_hal_delay_ms(i32 250)
ret void
}
double _add(double a1, double a2) { return a1 + a2; }


x86 assembly (clang, -O0):
<_add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_add>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @_add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
void *test_anti_range_92(unsigned n) {
  extern void *alloc_anti_range_92(unsigned) __attribute__((alloc_size(1)));
  if ((0x7fffffff * 2U + 1) - 2 <= n && n <= (0x7fffffff * 2U + 1) - 1)
    n = (0x7fffffff * 2U + 1) - 2 - 1;
  return alloc_anti_range_92(n);
}


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

x86 assembly (clang, -O2):
<test_anti_range_92>:
lea    0x3(%rdi),%eax
cmp    $0x2,%eax
mov    $0xfffffffc,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_92@plt>

LLVM IR (-O0):
define i8* @test_anti_range_92(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 -3, %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 -4, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_92(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_92(i32 %0) {
%2 = add i32 %0, 3
%3 = icmp ult i32 %2, 2
%4 = select i1 %3, i32 -4, i32 %0
%5 = tail call i8* @alloc_anti_range_92(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int util_func();
void toolkit_func() { printf("toolkit func, x = %d\n", util_func()); }


x86 assembly (clang, -O0):
<toolkit_func>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <util_func@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<toolkit_func>:
push   %rax
xor    %eax,%eax
call   1030 <util_func@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"toolkit func, x = %d\0A\00"
define void @toolkit_func() {
%1 = call i32 (...) @util_func()
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"toolkit func, x = %d\0A\00"
define void @toolkit_func() {
%1 = tail call i32 (...) @util_func()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void paw_dealloc_1d_array(double *array) { free(array); }


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

x86 assembly (clang, -O2):
<paw_dealloc_1d_array>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @paw_dealloc_1d_array(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
void RTTimerLRDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimerLRDestroy() {
ret void
}
long CG_spacereg(i)
long i;
{ return (((i & 4) << 11) | ((i & 3) << 14)); }


x86 assembly (clang, -O0):
<CG_spacereg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x4,%rax
shl    $0xb,%rax
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
shl    $0xe,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_spacereg>:
mov    %edi,%ecx
and    $0x4,%ecx
shl    $0xb,%rcx
shl    $0xe,%edi
movzwl %di,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @CG_spacereg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4
%5 = shl i64 %4, 11
%6 = load i64, i64* %2
%7 = and i64 %6, 3
%8 = shl i64 %7, 14
%9 = or i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @CG_spacereg(i64 %0) {
%2 = shl i64 %0, 11
%3 = and i64 %2, 8192
%4 = shl i64 %0, 14
%5 = and i64 %4, 49152
%6 = or i64 %3, %5
ret i64 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int hi8(int);
int lo8(int);
uint16_t crc_ccitt_update(uint16_t crc, uint8_t data) {
  data ^= lo8(crc);
  data ^= data << 4;
  return ((((uint16_t)data << 8) | hi8(crc)) ^ (uint8_t)(data >> 4) ^
          ((uint16_t)data << 3));
}


x86 assembly (clang, -O0):
<crc_ccitt_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lo8@plt>
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hi8@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_ccitt_update>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
call   1030 <lo8@plt>
mov    %eax,%ebx
xor    %r14d,%ebx
mov    %ebx,%eax
shl    $0x4,%eax
xor    %eax,%ebx
mov    %ebx,%ebp
shl    $0x8,%ebp
mov    %r15d,%edi
call   1040 <hi8@plt>
or     %ebp,%eax
mov    %ebx,%ecx
sar    $0x4,%ecx
shl    $0x3,%ebx
xor    %ecx,%ebx
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @crc_ccitt_update(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 = call i32 @lo8(i32 %5)
%7 = load i32, i32* %4
%8 = xor i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = shl i32 %9, 4
%11 = load i32, i32* %4
%12 = xor i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = call i32 @hi8(i32 %15)
%17 = or i32 %14, %16
%18 = load i32, i32* %4
%19 = ashr i32 %18, 4
%20 = xor i32 %17, %19
%21 = load i32, i32* %4
%22 = shl i32 %21, 3
%23 = xor i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @crc_ccitt_update(i32 %0, i32 %1) {
%3 = tail call i32 @lo8(i32 %0)
%4 = xor i32 %3, %1
%5 = shl i32 %4, 4
%6 = xor i32 %5, %4
%7 = shl i32 %6, 8
%8 = tail call i32 @hi8(i32 %0)
%9 = or i32 %7, %8
%10 = ashr i32 %6, 4
%11 = shl i32 %6, 3
%12 = xor i32 %11, %10
%13 = xor i32 %12, %9
ret i32 %13
}
/* Variables and functions */
long dsfmt_get_min_array_size();
long get_min_array_size(void) { return dsfmt_get_min_array_size(); }


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

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

LLVM IR (-O0):
define i64 @get_min_array_size() {
%1 = call i64 (...) @dsfmt_get_min_array_size()
ret i64 %1
}

LLVM IR (-O2):
define i64 @get_min_array_size() {
%1 = tail call i64 (...) @dsfmt_get_min_array_size()
ret i64 %1
}
void tegra_rtc_set_trigger(unsigned long cycles) {}


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

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

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

LLVM IR (-O2):
define void @tegra_rtc_set_trigger(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calcSinusArray();
int /*<<< orphan*/ cli();
int /*<<< orphan*/ sei();
void initMotorStuff() {
  cli();
  calcSinusArray();
  sei();
}


x86 assembly (clang, -O0):
<initMotorStuff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <cli@plt>
mov    $0x0,%al
call   1030 <calcSinusArray@plt>
mov    $0x0,%al
call   1040 <sei@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initMotorStuff>:
push   %rax
xor    %eax,%eax
call   1050 <cli@plt>
xor    %eax,%eax
call   1030 <calcSinusArray@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sei@plt>

LLVM IR (-O0):
define void @initMotorStuff() {
%1 = call i32 (...) @cli()
%2 = call i32 (...) @calcSinusArray()
%3 = call i32 (...) @sei()
ret void
}

LLVM IR (-O2):
define void @initMotorStuff() {
%1 = tail call i32 (...) @cli()
%2 = tail call i32 (...) @calcSinusArray()
%3 = tail call i32 (...) @sei()
ret void
}
/* Variables and functions */
int percentile_value(unsigned char **);
int /*<<< orphan*/ sprintf(char *, char *, int);
int f_percent(int mode, unsigned char **sec, float *data, unsigned int ndata,
              char *inv_out, void **local) {
  int percent;
  if (mode >= 0) {
    percent = percentile_value(sec);
    if (percent >= 0)
      sprintf(inv_out, "%d%%", percent);
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_percent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1176 <f_percent+0x56>
mov    -0x10(%rbp),%rdi
call   1030 <percentile_value@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     1171 <f_percent+0x51>
mov    -0x28(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xe94(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1176 <f_percent+0x56>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_percent>:
push   %rbx
test   %edi,%edi
js     1145 <f_percent+0x25>
mov    %r8,%rbx
mov    %rsi,%rdi
call   1030 <percentile_value@plt>
test   %eax,%eax
js     1145 <f_percent+0x25>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%%\00"
define i32 @f_percent(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca i32
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%14 = load i32, i32* %7
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %6
%17 = load i8**, i8*** %8
%18 = call i32 @percentile_value(i8** %17)
store i32 %18, i32* %13
%19 = load i32, i32* %13
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = load i8*, i8** %11
%23 = load i32, i32* %13
%24 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %21, %16
br label %26
26: ; preds = %25, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%%\00"
define i32 @f_percent(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture writeonly %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %13
8: ; preds = %6
%9 = tail call i32 @percentile_value(i8** %1)
%10 = icmp sgt i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %13
13: ; preds = %8, %11, %6
ret i32 0
}
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
char *CString_safeStrncpy(char *restrict dest, const char *restrict src,
                          size_t n) {
  char *ret = strncpy(dest, src, n);
  dest[n - 1] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<CString_safeStrncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CString_safeStrncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @CString_safeStrncpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @strncpy(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = sub i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @CString_safeStrncpy(i8* noalias returned %0, i8* noalias nocapture %1, i64 %2) {
%4 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
double f2(double x) { return __builtin_cos(x); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
void rop3_42_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

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

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

LLVM IR (-O2):
define void @rop3_42_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void testCondOp(int *p) {
  int *x = p ? p : p;
  *x = 1;
}


x86 assembly (clang, -O0):
<testCondOp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <testCondOp+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <testCondOp+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCondOp>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @testCondOp(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Type definitions */
struct vt_page {
  int dummy;
};
struct vbi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vbi_send(struct vbi *, int, int, int /*<<< orphan*/,
                            int /*<<< orphan*/, struct vt_page *);
struct vt_page *vbi_query_page(struct vbi *vbi, int pgno, int subno) {
  struct vt_page *vtp = 0;
  (void)pgno;
  (void)subno;
  if (vtp == 0) {
    return 0;
  }
  vbi_send(vbi, 5, 1, 0, 0, vtp);
  return vtp;
}


x86 assembly (clang, -O0):
<vbi_query_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1142 <vbi_query_page+0x32>
movq   $0x0,-0x8(%rbp)
jmp    1167 <vbi_query_page+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%r9
mov    $0x5,%esi
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <vbi_send@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vt_page = type { i32 }
%struct.vbi = type { i32 }
define %struct.vt_page* @vbi_query_page(%struct.vbi* %0, i32 %1, i32 %2) {
%4 = alloca %struct.vt_page*
%5 = alloca %struct.vbi*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.vt_page*
store %struct.vbi* %0, %struct.vbi** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.vt_page* null, %struct.vt_page** %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load %struct.vt_page*, %struct.vt_page** %8
%12 = icmp eq %struct.vt_page* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store %struct.vt_page* null, %struct.vt_page** %4
br label %19
14: ; preds = %3
%15 = load %struct.vbi*, %struct.vbi** %5
%16 = load %struct.vt_page*, %struct.vt_page** %8
%17 = call i32 @vbi_send(%struct.vbi* %15, i32 5, i32 1, i32 0, i32 0, %struct.vt_page* %16)
%18 = load %struct.vt_page*, %struct.vt_page** %8
store %struct.vt_page* %18, %struct.vt_page** %4
br label %19
19: ; preds = %14, %13
%20 = load %struct.vt_page*, %struct.vt_page** %4
ret %struct.vt_page* %20
}

LLVM IR (-O2):
%struct.vt_page = type { i32 }
%struct.vbi = type { i32 }
define noalias %struct.vt_page* @vbi_query_page(%struct.vbi* nocapture readnone %0, i32 %1, i32 %2) {
ret %struct.vt_page* null
}
float somaVetAte0(float *vet) {
  float soma = 0;
  while (*vet) {
    soma += *vet;
    vet++;
  }
  return soma;
}


x86 assembly (clang, -O0):
<somaVetAte0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112f <somaVetAte0+0x2f>
jp     112f <somaVetAte0+0x2f>
jmp    1152 <somaVetAte0+0x52>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <somaVetAte0+0x10>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<somaVetAte0>:
movss  (%rdi),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    110e <somaVetAte0+0xe>
jnp    1133 <somaVetAte0+0x33>
add    $0x4,%rdi
xorps  %xmm2,%xmm2
xorps  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
addss  %xmm1,%xmm0
movss  (%rdi),%xmm1
add    $0x4,%rdi
ucomiss %xmm2,%xmm1
jne    1120 <somaVetAte0+0x20>
jp     1120 <somaVetAte0+0x20>
ret

LLVM IR (-O0):
define float @somaVetAte0(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
store float 0.000000e+00, float* %3
br label %4
4: ; preds = %8, %1
%5 = load float*, float** %2
%6 = load float, float* %5
%7 = fcmp une float %6, 0.000000e+00
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load float*, float** %2
%10 = load float, float* %9
%11 = load float, float* %3
%12 = fadd float %11, %10
store float %12, float* %3
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i32 1
store float* %14, float** %2
br label %4
15: ; preds = %4
%16 = load float, float* %3
ret float %16
}

LLVM IR (-O2):
define float @somaVetAte0(float* nocapture %0) {
%2 = load float, float* %0
%3 = fcmp une float %2, 0.000000e+00
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi float [ %10, %4 ], [ %2, %1 ]
%6 = phi float [ %8, %4 ], [ 0.000000e+00, %1 ]
%7 = phi float* [ %9, %4 ], [ %0, %1 ]
%8 = fadd float %6, %5
%9 = getelementptr inbounds float, float* %7, i64 1
%10 = load float, float* %9
%11 = fcmp une float %10, 0.000000e+00
br i1 %11, label %4, label %12
12: ; preds = %4, %1
%13 = phi float [ 0.000000e+00, %1 ], [ %8, %4 ]
ret float %13
}
void modif_rear_unit2MODIF_P() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear_unit2MODIF_P() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
int check_if_list(char *cmd) {
  char *first = strtok(cmd, " ");
  return strcmp(first, "list") == 0;
}


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

x86 assembly (clang, -O2):
<check_if_list>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strtok@plt>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"list\00"
define i32 @check_if_list(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"list\00"
define i32 @check_if_list(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ wclrtoeol(int /*<<< orphan*/);
void display_clear_to_eol(void) { wclrtoeol(stdscr); }


x86 assembly (clang, -O0):
<display_clear_to_eol>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <wclrtoeol@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_clear_to_eol>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <wclrtoeol@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @display_clear_to_eol() {
%1 = load i32, i32* @stdscr
%2 = call i32 @wclrtoeol(i32 %1)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @display_clear_to_eol() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @wclrtoeol(i32 %1)
ret void
}
/* Variables and functions */
unsigned long snprintf(char *, unsigned long, char *);
unsigned long log_fd_write_newline(char *buf, unsigned long free_bytes) {
  return snprintf(buf, free_bytes, "\n");
}


x86 assembly (clang, -O0):
<log_fd_write_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_fd_write_newline>:
lea    0xee9(%rip),%rdx
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i64 @log_fd_write_newline(i8* %0, i64 %1) {
%3 = tail call i64 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i64 %3
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int getc(int /*<<< orphan*/);
int my_getc(struct aFILE *fp) { return getc(_get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
call   1040 <getc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getc>:
push   %rax
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <getc@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_getc(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i32 @getc(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_getc(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i32 @getc(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ rs274ngc_line_text(char *, int);
const char *rs274ngc_command() {
  static char buf[100];
  rs274ngc_line_text(buf, 100);
  return buf;
}


x86 assembly (clang, -O0):
<rs274ngc_command>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x64,%esi
call   1030 <rs274ngc_line_text@plt>
lea    0x2f14(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs274ngc_command>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <rs274ngc_line_text@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@rs274ngc_command.buf = internal global [100 x i8] zeroinitializer
define i8* @rs274ngc_command() {
%1 = call i32 @rs274ngc_line_text(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_command.buf, i64 0, i64 0), i32 100)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_command.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@rs274ngc_command.buf = internal global [100 x i8] zeroinitializer
define i8* @rs274ngc_command() {
%1 = tail call i32 @rs274ngc_line_text(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_command.buf, i64 0, i64 0), i32 100)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_command.buf, i64 0, i64 0)
}