xunge/DecIR huggingface dataset:
/* Variables and functions */
int log2(int);
int nextpow2(int n) {
  int level;
  int n1;
  level = log2(n);
  n1 = (1 << level);
  if (n1 < n)
    level += 1;
  return level;
}


x86 assembly (clang, -O0):
<nextpow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <log2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <nextpow2+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextpow2>:
push   %rbx
mov    %edi,%ebx
call   1030 <log2@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
xor    %ecx,%ecx
cmp    %ebx,%edx
setl   %cl
add    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @nextpow2(i32 %0) {
%2 = tail call i32 @log2(i32 %0)
%3 = shl nuw i32 1, %2
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
int main(void) {
  char test_string[] = "Kumquat!";
  squeeze(test_string, "Squat.");
  printf("%s\n", test_string);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xd(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <squeeze@plt>
lea    -0xd(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x21746175716d754b,%rax
61 74 21
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xeca(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <squeeze@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.test_string = [9 x i8] c"Kumquat!\00"
@.str = [7 x i8] c"Squat.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
store i32 0, i32* %1
%3 = bitcast [9 x i8]* %2 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @squeeze(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@__const.main.test_string = [9 x i8] c"Kumquat!\00"
@.str = [7 x i8] c"Squat.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @squeeze(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
char *bar();
char *baz();
int foo();
int /*<<< orphan*/ printf(char *, int, char *, char *);
int main() { printf("%d %s: %s\n", foo(), bar(), baz()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <baz@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe8b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <foo@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <bar@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <baz@plt>
lea    0xe9c(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d %s: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i8* (...) @bar()
%3 = tail call i8* (...) @baz()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
void checkOutOfLimits(unsigned int size, clock_t elapsedtime) {}


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

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

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

LLVM IR (-O2):
define void @checkOutOfLimits(i32 %0, i32 %1) {
ret void
}
int empty_function(int i) {
  int j;
  j = i;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @empty_function(i32 %0) {
ret i32 0
}
/* Variables and functions */
int calculate(int, int);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  printf("%s:Hello World (calculate(2,3)=%d)\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/OrangeTide/build/refs/heads/master/example/"
         "b/b.c",
         calculate(2, 3));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <calculate@plt>
lea    0xec9(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"%s:Hello World (calculate(2,3)=%d)\0A\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OrangeTide/build/refs/heads/master/example/b/b.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @calculate(i32 2, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"%s:Hello World (calculate(2,3)=%d)\0A\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OrangeTide/build/refs/heads/master/example/b/b.c\00"
define i32 @main() {
%1 = tail call i32 @calculate(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
void gdk_display_request_selection_notification() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_error(int, char *);
int pthread_cond_destroy(int /*<<< orphan*/ *);
void conditionDestroy(pthread_cond_t *cond) {
  ASSERT(cond);
  int r = pthread_cond_destroy(cond);
  if (r != 0) {
    log_error(r, "Error pthread_cond_destroy()");
    abort();
  }
}


x86 assembly (clang, -O0):
<conditionDestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1050 <pthread_cond_destroy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1181 <conditionDestroy+0x41>
mov    -0xc(%rbp),%edi
lea    0xe8b(%rip),%rsi
call   1040 <log_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditionDestroy>:
push   %rbx
mov    %rdi,%rbx
call   1060 <ASSERT@plt>
mov    %rbx,%rdi
call   1050 <pthread_cond_destroy@plt>
test   %eax,%eax
jne    1157 <conditionDestroy+0x17>
pop    %rbx
ret
lea    0xea2(%rip),%rsi
mov    %eax,%edi
call   1040 <log_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error pthread_cond_destroy()\00"
define void @conditionDestroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @ASSERT(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @pthread_cond_destroy(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @log_error(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Error pthread_cond_destroy()\00"
define void @conditionDestroy(i32* %0) {
%2 = tail call i32 @ASSERT(i32* %0)
%3 = tail call i32 @pthread_cond_destroy(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @log_error(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
void sys_set_priority(int p_priority) {
  asm volatile("int %0\n" : : "i"(50), "a"(p_priority) : "cc", "memory");
}


x86 assembly (clang, -O0):
<sys_set_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int    $0x32
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_set_priority>:
mov    %edi,%eax
int    $0x32
ret

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

LLVM IR (-O2):
define void @sys_set_priority(i32 %0) {
tail call void asm sideeffect "int $0\0A", "i,{ax},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 50, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ harness(int, int, int);
int main() {
  harness(1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <harness@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <harness@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @harness(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @harness(i32 1, i32 2, i32 3)
ret i32 0
}
void av_codec_get_seek_preroll() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_get_seek_preroll() {
ret void
}
int h1(int key) { return (key % 8495); }


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

x86 assembly (clang, -O2):
<h1>:
movslq %edi,%rax
imul   $0x1edbceb3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
imul   $0x212f,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @h1(i32 %0) {
%2 = srem i32 %0, 8495
ret i32 %2
}
/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/, char *, char const *, char const *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ write_error();
void write_metadata(const char *key, const char *value) {
  if (fprintf(stdout, "%s:\t%s\n", key, value) < 0) {
    write_error();
  }
}


x86 assembly (clang, -O0):
<write_metadata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    115e <write_metadata+0x3e>
mov    $0x0,%al
call   1040 <write_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_metadata>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
test   %rax,%rax
js     1143 <write_metadata+0x23>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_error@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"%s:\09%s\0A\00"
define void @write_metadata(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @write_error()
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"%s:\09%s\0A\00"
define void @write_metadata(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @write_error()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int core7_safe(char const *);
int U_EMRSETVIEWPORTEXTEX_safe(const char *record) {
  return (core7_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRSETVIEWPORTEXTEX_safe>:
jmp    1030 <core7_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETVIEWPORTEXTEX_safe(i8* %0) {
%2 = tail call i32 @core7_safe(i8* %0)
ret i32 %2
}
int list_categories(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @list_categories() {
ret i32 1
}
void App_UsageFault_ISR(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @App_UsageFault_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int strlen(char *);
void shiftCharsToCoverLine(char **settingsText, char **dest,
                           char **newLinePtr) {
  int remaining =
      strlen(*settingsText) - (*newLinePtr - *settingsText) / sizeof(char);
  memmove(*dest, (*newLinePtr + 1), remaining * sizeof(char));
}


x86 assembly (clang, -O0):
<shiftCharsToCoverLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
cltq
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rdx
sub    %rdx,%rcx
shr    $0x0,%rcx
sub    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
add    $0x1,%rsi
movslq -0x1c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftCharsToCoverLine>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <strlen@plt>
mov    (%r15),%rsi
mov    (%rbx),%edx
sub    %esi,%edx
add    %eax,%edx
mov    (%r14),%rdi
add    $0x1,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define void @shiftCharsToCoverLine(i8** %0, i8** %1, i8** %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = load i8**, i8*** %6
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = ptrtoint i8* %13 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = udiv i64 %18, 1
%20 = sub i64 %11, %19
%21 = trunc i64 %20 to i32
store i32 %21, i32* %7
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %6
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 1
%30 = trunc i64 %29 to i32
%31 = call i32 @memmove(i8* %23, i8* %26, i32 %30)
ret void
}

LLVM IR (-O2):
define void @shiftCharsToCoverLine(i8** nocapture %0, i8** nocapture %1, i8** nocapture %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @strlen(i8* %4)
%6 = load i8*, i8** %2
%7 = load i8*, i8** %0
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %9, %8
%11 = trunc i64 %10 to i32
%12 = add i32 %5, %11
%13 = load i8*, i8** %1
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = tail call i32 @memmove(i8* %13, i8* %14, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help() {
  puts("usage: xor-table [-hv]");
  puts("");
  puts("Options:");
  puts("  -h       help");
  puts("  -v       version");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: xor-table [-hv]\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [9 x i8] c"Options:\00"
@.str.3 = [16 x i8] c" -h help\00"
@.str.4 = [19 x i8] c" -v version\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: xor-table [-hv]\00"
@.str.2 = [9 x i8] c"Options:\00"
@.str.3 = [16 x i8] c" -h help\00"
@.str.4 = [19 x i8] c" -v version\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ work(int, int);
void wrong5(int n) {
#pragma omp parallel
  {
#pragma omp critical
    {
      work(n, 0);
#pragma omp barrier
      work(n, 1);
    }
  }
}


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

x86 assembly (clang, -O2):
<wrong5>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <work@plt>
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <work@plt>

LLVM IR (-O0):
define void @wrong5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @work(i32 %3, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @work(i32 %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @wrong5(i32 %0) {
%2 = tail call i32 @work(i32 %0, i32 0)
%3 = tail call i32 @work(i32 %0, i32 1)
ret void
}
int is_alpha(unsigned char n) {
  if (n <= 102 && n >= 97) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1130 <is_alpha+0x30>
movzbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_alpha+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_alpha+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x6,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_alpha(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
char *main() { int i = (5 * 3) + 2; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x11,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @main() {
%1 = alloca i8*
%2 = alloca i32
store i32 17, i32* %2
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @main() {
ret i8* undef
}
double _Complex add_double_cc(double _Complex a, double _Complex b) {
  return a + b;
}


x86 assembly (clang, -O0):
<add_double_cc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
addsd  %xmm3,%xmm1
addsd  %xmm2,%xmm0
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

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

LLVM IR (-O0):
define { double, double } @add_double_cc(double %0, double %1, double %2, double %3) {
%5 = alloca { double, double }
%6 = alloca { double, double }
%7 = alloca { double, double }
%8 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
store double %0, double* %8
%9 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %1, double* %9
%10 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
store double %2, double* %10
%11 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
store double %3, double* %11
%12 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%13 = load double, double* %12
%14 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
%17 = load double, double* %16
%18 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
%19 = load double, double* %18
%20 = fadd double %13, %17
%21 = fadd double %15, %19
%22 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%23 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %20, double* %22
store double %21, double* %23
%24 = load { double, double }, { double, double }* %5
ret { double, double } %24
}

LLVM IR (-O2):
define { double, double } @add_double_cc(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, %2
%6 = fadd double %1, %3
%7 = insertvalue { double, double } poison, double %5, 0
%8 = insertvalue { double, double } %7, double %6, 1
ret { double, double } %8
}
void timerInit() {}


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

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

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

LLVM IR (-O2):
define void @timerInit() {
ret void
}
/* Variables and functions */
int setcns(int, int, char *);
int cmd_gps_off(int argc, char **argv) {
  char data[] = {0x00, 0x01, 0x00, 0x01};
  return setcns(0x0F14, 4, data);
}


x86 assembly (clang, -O0):
<cmd_gps_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdx
mov    $0xf14,%edi
mov    $0x4,%esi
call   1030 <setcns@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_gps_off>:
push   %rax
movl   $0x1000100,0x4(%rsp)
01
lea    0x4(%rsp),%rdx
mov    $0xf14,%edi
mov    $0x4,%esi
call   1030 <setcns@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.cmd_gps_off.data = [4 x i8] c"\00\01\00\01"
define i32 @cmd_gps_off(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [4 x i8]* %5 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = call i32 @setcns(i32 3860, i32 4, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmd_gps_off(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 16777472, i32* %3
%5 = call i32 @setcns(i32 3860, i32 4, i8* %4)
ret i32 %5
}
void swap(int *array, int a, int b) {
  int temp = array[a];
  array[a] = array[b];
  array[b] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void foo312() {}


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

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

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

LLVM IR (-O2):
define void @foo312() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tsd_dtor(void *data) { free(data); }


x86 assembly (clang, -O0):
<tsd_dtor>:
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):
<tsd_dtor>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tsd_dtor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned char f55(unsigned char x, unsigned int y) {
  return (x << (8 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f55>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f55>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f55(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 8, %7
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = xor i32 %9, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f55(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 8, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
float QuarticEaseInOut(float p) {
  if (p < 0.5) {
    return 8 * p * p * p * p;
  } else {
    float f = (p - 1);
    return -8 * f * f * f * f + 1;
  }
}


x86 assembly (clang, -O0):
<QuarticEaseInOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <QuarticEaseInOut+0x4a>
movss  0xee4(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1191 <QuarticEaseInOut+0x91>
movss  -0x8(%rbp),%xmm0
movss  0xeb1(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xea4(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe80(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuarticEaseInOut>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1129 <QuarticEaseInOut+0x29>
movss  0xefb(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
addss  0xed3(%rip),%xmm0
movss  0xecf(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  0xebb(%rip),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @QuarticEaseInOut(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 5.000000e-01
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load float, float* %3
%10 = fmul float 8.000000e+00, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = load float, float* %3
%16 = fmul float %14, %15
store float %16, float* %2
br label %28
17: ; preds = %1
%18 = load float, float* %3
%19 = fsub float %18, 1.000000e+00
store float %19, float* %4
%20 = load float, float* %4
%21 = fmul float -8.000000e+00, %20
%22 = load float, float* %4
%23 = fmul float %21, %22
%24 = load float, float* %4
%25 = fmul float %23, %24
%26 = load float, float* %4
%27 = call float @llvm.fmuladd.f32(float %25, float %26, float 1.000000e+00)
store float %27, float* %2
br label %28
28: ; preds = %17, %8
%29 = load float, float* %2
ret float %29
}

LLVM IR (-O2):
define float @QuarticEaseInOut(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fmul float %0, 8.000000e+00
%5 = fmul float %4, %0
%6 = fmul float %5, %0
%7 = fmul float %6, %0
br label %14
8: ; preds = %1
%9 = fadd float %0, -1.000000e+00
%10 = fmul float %9, -8.000000e+00
%11 = fmul float %9, %10
%12 = fmul float %9, %11
%13 = tail call float @llvm.fmuladd.f32(float %12, float %9, float 1.000000e+00)
br label %14
14: ; preds = %8, %3
%15 = phi float [ %7, %3 ], [ %13, %8 ]
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void getPymentMethod() { printf("Processing payment...\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"Processing payment...\00"
define void @getPymentMethod() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char const *);
char *strrchr(char const *, char);
const char *filename_extension(const char *filename) {
  const char *ext;
  ext = strrchr(filename, '.');
  if (ext == NULL)
    ext = filename + strlen(filename);
  else
    ext = ext + 1;
  return ext;
}


x86 assembly (clang, -O0):
<filename_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <filename_extension+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    117b <filename_extension+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename_extension>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1139 <filename_extension+0x19>
add    $0x1,%rax
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @filename_extension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8* %13, i8** %3
br label %17
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %3
br label %17
17: ; preds = %14, %8
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @filename_extension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
br label %10
8: ; preds = %1
%9 = getelementptr inbounds i8, i8* %2, i64 1
br label %10
10: ; preds = %8, %4
%11 = phi i8* [ %7, %4 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(int argc, char *argv[]) {
  printf("Usage: %s <repeatRate> <count>\n"
         "repeatRate is an integer percentage, 0-100 (the config program "
         "limits this to 1-50).\n"
         "count is how many timeslots to print.\n",
         (argc > 0) ? argv[0] : "");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1139 <printUsage+0x29>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <printUsage+0x39>
lea    0xf5a(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <printUsage+0x39>
mov    -0x18(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
test   %edi,%edi
jle    1123 <printUsage+0x13>
mov    (%rsi),%rsi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xf70(%rip),%rsi
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [155 x i8] c"Usage: %s <repeatRate> <count>\0ArepeatRate is an integer percentage, 0-100 (the config program limits this to 1-50).\0Acount is how many timeslots to print.\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @printUsage(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %7
%13 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %11 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [155 x i8] c"Usage: %s <repeatRate> <count>\0ArepeatRate is an integer percentage, 0-100 (the config program limits this to 1-50).\0Acount is how many timeslots to print.\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @printUsage(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i8*, i8** %1
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}
int cmp_int_func(const void *a, const void *b) {
  if (*(int *)a > *(int *)b)
    return -1;
  else if (*(int *)a == *(int *)b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<cmp_int_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <cmp_int_func+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <cmp_int_func+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <cmp_int_func+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <cmp_int_func+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int_func>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_int_func(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISFIFO(int /*<<< orphan*/);
int C_S_ISFIFO(mode_t mode) { return S_ISFIFO(mode); }


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

x86 assembly (clang, -O2):
<C_S_ISFIFO>:
jmp    1030 <S_ISFIFO@plt>

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

LLVM IR (-O2):
define i32 @C_S_ISFIFO(i32 %0) {
%2 = tail call i32 @S_ISFIFO(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t signum_u64(uint64_t i) {
  if (i > 0)
    return 1;
  return 0;
}


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

x86 assembly (clang, -O2):
<signum_u64>:
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i64 @signum_u64(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %8
7: ; preds = %1
store i64 0, i64* %2
br label %8
8: ; preds = %7, %6
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @signum_u64(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned int);
void print_int_bits(unsigned int v) {
  int i;
  for (i = 31; i >= 0; i--)
    putchar('0' + ((v >> i) & 1));
}


x86 assembly (clang, -O0):
<print_int_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114d <print_int_bits+0x3d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
shr    %cl,%edi
and    $0x1,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_int_bits+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1f,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%ecx
shr    %cl,%edi
and    $0x1,%edi
or     $0x30,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jb     1120 <print_int_bits+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print_int_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 31, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = lshr i32 %8, %9
%11 = and i32 %10, 1
%12 = add i32 48, %11
%13 = call i32 @putchar(i32 %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @print_int_bits(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 31, %1 ], [ %8, %2 ]
%4 = lshr i32 %0, %3
%5 = and i32 %4, 1
%6 = or i32 %5, 48
%7 = tail call i32 @putchar(i32 %6)
%8 = add nsw i32 %3, -1
%9 = icmp eq i32 %3, 0
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
float expf(float);
float sinhf(float x) { return .5f * (expf(x) - expf(-x)); }


x86 assembly (clang, -O0):
<sinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <expf@plt>
movss  -0x8(%rbp),%xmm1
subss  %xmm0,%xmm1
movss  0xeac(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinhf>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <expf@plt>
movss  %xmm0,0xc(%rsp)
movaps 0x10(%rsp),%xmm0
xorps  0xed0(%rip),%xmm0
call   1030 <expf@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
mulss  0xec9(%rip),%xmm1
movaps %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @sinhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @expf(float %3)
%5 = load float, float* %2
%6 = fneg float %5
%7 = call float @expf(float %6)
%8 = fsub float %4, %7
%9 = fmul float 5.000000e-01, %8
ret float %9
}

LLVM IR (-O2):
define float @sinhf(float %0) {
%2 = tail call float @expf(float %0)
%3 = fneg float %0
%4 = tail call float @expf(float %3)
%5 = fsub float %2, %4
%6 = fmul float %5, 5.000000e-01
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ get_default_sched_policy();
int sched_get_priority_max(int /*<<< orphan*/);
int get_default_sched_prio(void) {
  return sched_get_priority_max(get_default_sched_policy());
}


x86 assembly (clang, -O0):
<get_default_sched_prio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_default_sched_policy@plt>
mov    %eax,%edi
call   1040 <sched_get_priority_max@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_default_sched_prio>:
push   %rax
xor    %eax,%eax
call   1030 <get_default_sched_policy@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sched_get_priority_max@plt>

LLVM IR (-O0):
define i32 @get_default_sched_prio() {
%1 = call i32 (...) @get_default_sched_policy()
%2 = call i32 @sched_get_priority_max(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_default_sched_prio() {
%1 = tail call i32 (...) @get_default_sched_policy()
%2 = tail call i32 @sched_get_priority_max(i32 %1)
ret i32 %2
}