xunge/DecIR huggingface dataset:
long __syscall4(long num, long arg1, long arg2, long arg3, long arg4) {
  unsigned long result;
  register long r10 asm("r10") = arg4;
  asm volatile("syscall"
               : "=a"(result)
               : "a"(num), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10)
               : "memory", "rcx", "r11");
  return result;
}


x86 assembly (clang, -O0):
<__syscall4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%r10
syscall
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall4>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
syscall
ret

LLVM IR (-O0):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%13 = load i64, i64* %10
store i64 %13, i64* %12
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = load i64, i64* %8
%17 = load i64, i64* %9
%18 = load i64, i64* %12
%19 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %14, i64 %15, i64 %16, i64 %17, i64 %18)
store i64 %19, i64* %11
%20 = load i64, i64* %11
ret i64 %20
}

LLVM IR (-O2):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void error_msg(char *msg) {
  printf("erreur : %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_msg>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"erreur : %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"erreur : %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_msg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr, "usage: %s pcap-file\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s pcap-file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s pcap-file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ appendchar(int /*<<< orphan*/);
void appendstring(char *s, int len) {
  while (len-- > 0) {
    appendchar(*s++);
  }
}


x86 assembly (clang, -O0):
<appendstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    114f <appendstring+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <appendchar@plt>
jmp    111f <appendstring+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendstring>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <appendstring+0x24>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
add    $0x1,%rbx
call   1030 <appendchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <appendstring+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @appendstring(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 @appendchar(i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @appendstring(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 @appendchar(i32 %10)
%12 = icmp ugt i32 %5, 1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_1(void *dest, void *src) {
  memcpy(dest, src, 1);
}


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

x86 assembly (clang, -O2):
<memcpy_1>:
mov    $0x1,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_1(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ SwapWord(char *, int);
short little2bigs(short num) {
  SwapWord((char *)&num, sizeof(num));
  return num;
}


x86 assembly (clang, -O0):
<little2bigs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <SwapWord@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little2bigs>:
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <SwapWord@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @little2bigs(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 2)
%5 = load i16, i16* %2
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @little2bigs(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 2)
%5 = load i16, i16* %2
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ join_strings(char **, int, char *, char *);
int strlen(char *);
int correct_path(char **path) {
  char *temp = *path;
  if (temp[strlen(temp) - 1] == '/')
    return 0;
  join_strings(path, 2, temp, "/");
  return 0;
}


x86 assembly (clang, -O0):
<correct_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    116d <correct_path+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    118d <correct_path+0x6d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x2,%esi
lea    0xe7f(%rip),%rcx
call   1040 <join_strings@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<correct_path>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
je     1152 <correct_path+0x32>
lea    0xebe(%rip),%rcx
mov    %r14,%rdi
mov    $0x2,%esi
mov    %rbx,%rdx
call   1040 <join_strings@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @correct_path(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @join_strings(i8** %0, i32 2, i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %1, %9
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WaitMouseWheel278();
void waitmousewheel() { WaitMouseWheel278(); }


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

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

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

LLVM IR (-O2):
define void @waitmousewheel() {
%1 = tail call i32 (...) @WaitMouseWheel278()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
char *get_filename(char *database, char *table_name, char *date_stamp) {
  static char filename[128];
  sprintf(filename, "%s_%s_%s.csv", database, table_name, date_stamp);
  return filename;
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0x2f09(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef6(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
push   %rbx
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x2f1f(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_filename.filename = internal global [128 x i8] zeroinitializer
@.str = [13 x i8] c"%s_%s_%s.csv\00"
define i8* @get_filename(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** %5
%9 = load i8*, i8** %6
%10 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0)
}

LLVM IR (-O2):
@get_filename.filename = internal global [128 x i8] zeroinitializer
@.str = [13 x i8] c"%s_%s_%s.csv\00"
define i8* @get_filename(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
main() {
  int n1, n2, n3;
  printf("digite tres inteiros: ");
  scanf("%d %d %d", &n1, &n2, &n3);
  printf("%d", (n1 + n2 + n3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
add    0x14(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"digite tres inteiros: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"digite tres inteiros: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}
int util_fn(int x) {
  printf("%s\n", __func__);
  return 2 * x;
}


x86 assembly (clang, -O0):
<util_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_fn>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.util_fn = [8 x i8] c"util_fn\00"
define i32 @util_fn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.util_fn, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = mul nsw i32 2, %4
ret i32 %5
}

LLVM IR (-O2):
@__func__.util_fn = [8 x i8] c"util_fn\00"
define i32 @util_fn(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.util_fn, i64 0, i64 0))
%3 = shl nsw i32 %0, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "Usage: "
          "sg_rtpg   [--decode] [--help] [--hex] [--raw] [--verbose] "
          "[--version]\n"
          "                 DEVICE\n"
          "  where:\n"
          "    --decode|-d        decode status and asym. access state\n"
          "    --help|-h          print out usage message\n"
          "    --hex|-H           print out response in hex\n"
          "    --raw|-r           output response in binary to stdout\n"
          "    --verbose|-v       increase verbosity\n"
          "    --version|-V       print version string and exit\n\n"
          "Performs a SCSI REPORT TARGET PORT GROUPS command\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [472 x i8] c"Usage: sg_rtpg [--decode] [--help] [--hex] [--raw] [--verbose] [--version]\0A DEVICE\0A where:\0A --decode|-d decode status and asym. access state\0A --help|-h print out usage message\0A --hex|-H print out response in hex\0A --raw|-r output response in binary to stdout\0A --verbose|-v increase verbosity\0A --version|-V print version string and exit\0A\0APerforms a SCSI REPORT TARGET PORT GROUPS command\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([472 x i8], [472 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [472 x i8] c"Usage: sg_rtpg [--decode] [--help] [--hex] [--raw] [--verbose] [--version]\0A DEVICE\0A where:\0A --decode|-d decode status and asym. access state\0A --help|-h print out usage message\0A --hex|-H print out response in hex\0A --raw|-r output response in binary to stdout\0A --verbose|-v increase verbosity\0A --version|-V print version string and exit\0A\0APerforms a SCSI REPORT TARGET PORT GROUPS command\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([472 x i8], [472 x i8]* @.str, i64 0, i64 0))
ret void
}
void av_md5_init() {}


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

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

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

LLVM IR (-O2):
define void @av_md5_init() {
ret void
}
char *stpcpy(char *restrict to, const char *restrict from) {
  for (; (*to = *from); ++from, ++to)
    ;
  return (to);
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1142 <stpcpy+0x42>
jmp    1125 <stpcpy+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <stpcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     1122 <stpcpy+0x22>
add    $0x1,%rsi
nop
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <stpcpy+0x10>
ret

LLVM IR (-O0):
define i8* @stpcpy(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %11, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
store i8 %7, i8* %8
%9 = icmp ne i8 %7, 0
br i1 %9, label %10, label %16
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @stpcpy(i8* noalias writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: tx -t <SECS> <COMMAND>...\n");
  printf("Executes COMMAND for a number of seconds SECS.\n");
  printf("Arguments must agree with the form specified in Usage.\n");
  printf("Options:\n");
  printf("  -t: execute for the specified number of seconds.\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf48(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: tx -t <SECS> <COMMAND>...\0A\00"
@.str.1 = [48 x i8] c"Executes COMMAND for a number of seconds SECS.\0A\00"
@.str.2 = [56 x i8] c"Arguments must agree with the form specified in Usage.\0A\00"
@.str.3 = [10 x i8] c"Options:\0A\00"
@.str.4 = [52 x i8] c" -t: execute for the specified number of seconds.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Usage: tx -t <SECS> <COMMAND>...\00"
@str.5 = [47 x i8] c"Executes COMMAND for a number of seconds SECS.\00"
@str.6 = [55 x i8] c"Arguments must agree with the form specified in Usage.\00"
@str.7 = [9 x i8] c"Options:\00"
@str.8 = [51 x i8] c" -t: execute for the specified number of seconds.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.8, i64 0, i64 0))
ret void
}
int test_imm_FFint32_reg(int val) { return ((val) & (0xFF << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_FFint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_FFint32_reg(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void printBranch(int blockId, int branchId) {
  FILE *file = fopen("coverage.cov", "a");
  fprintf(file, "Reaching branch %d ", branchId);
  fclose(file);
}


x86 assembly (clang, -O0):
<printBranch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBranch>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0xec4(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"coverage.cov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [20 x i8] c"Reaching branch %d \00"
define void @printBranch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %4
%9 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"coverage.cov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [20 x i8] c"Reaching branch %d \00"
define void @printBranch(i32 %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FibnnacciCycle(int);
int /*<<< orphan*/ Fibonacci(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void interView09Test(void) {
  printf("Fibonacci(10):%zd\n", Fibonacci(10));
  printf("Fibonacci(10):%zd\n", FibnnacciCycle(10));
}


x86 assembly (clang, -O0):
<interView09Test>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <Fibonacci@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <FibnnacciCycle@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interView09Test>:
push   %rbx
mov    $0xa,%edi
call   1030 <Fibonacci@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <FibnnacciCycle@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Fibonacci(10):%zd\0A\00"
define void @interView09Test() {
%1 = call i32 @Fibonacci(i32 10)
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @FibnnacciCycle(i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Fibonacci(10):%zd\0A\00"
define void @interView09Test() {
%1 = tail call i32 @Fibonacci(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @FibnnacciCycle(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
unsigned int distorm_version() { return 0x030000; }


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

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

LLVM IR (-O0):
define i32 @distorm_version() {
ret i32 196608
}

LLVM IR (-O2):
define i32 @distorm_version() {
ret i32 196608
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int nanosleep(struct timespec *, struct timespec *);
int main(void) {
  struct timespec req, rem;
  req.tv_sec = 0;
  req.tv_nsec = 100000;
  rem.tv_sec = 0;
  rem.tv_nsec = 0;
  return nanosleep(&req, &rem);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x186a0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movq   $0x0,0x20(%rsp)
movl   $0x186a0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 100000, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 0, i32* %7
%8 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i32 @main() {
%1 = alloca %struct.timespec
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %1 to i8*
%4 = bitcast %struct.timespec* %2 to i8*
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 100000, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 0, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %1, %struct.timespec* %2)
ret i32 %9
}
int test_imm_12int16_mem(short *val) {
  return ((*val) & (-0x12 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_12int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -18
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
long long __sdivmod32(int /*<<< orphan*/, int /*<<< orphan*/, int);
long long __lux_sdiv32(int32_t a, int32_t b) { return __sdivmod32(a, b, 1); }


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

x86 assembly (clang, -O2):
<__lux_sdiv32>:
mov    $0x1,%edx
jmp    1030 <__sdivmod32@plt>

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

LLVM IR (-O2):
define i64 @__lux_sdiv32(i32 %0, i32 %1) {
%3 = tail call i64 @__sdivmod32(i32 %0, i32 %1, i32 1)
ret i64 %3
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ execvp(char const *, char *const *);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ init_wait_cb();
void jb_execvp(const char *command, char *const argv[]) {
  if (fork() == 0) {
    errno = 0;
    execvp(command, argv);
    exit(1);
  } else
    init_wait_cb();
}


x86 assembly (clang, -O0):
<jb_execvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
jne    1186 <jb_execvp+0x46>
mov    0x2e78(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <execvp@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <init_wait_cb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jb_execvp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1164 <jb_execvp+0x24>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <init_wait_cb@plt>
mov    0x2e75(%rip),%rax
movq   $0x0,(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <execvp@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
define void @jb_execvp(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
store i64 0, i64* @errno
%8 = load i8*, i8** %3
%9 = load i8**, i8*** %4
%10 = call i32 @execvp(i8* %8, i8** %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = call i32 (...) @init_wait_cb()
br label %14
14: ; preds = %12
ret void
}

LLVM IR (-O2):
@errno = global i64 0
define void @jb_execvp(i8* %0, i8** %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
store i64 0, i64* @errno
%6 = tail call i32 @execvp(i8* %0, i8** %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 (...) @init_wait_cb()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void hello(void) { puts("Hello, from shared library"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Hello, from shared library\00"
define void @hello() {
%1 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Hello, from shared library\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error1(char *message) {
  printf("%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<error1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error1>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @error1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int Tcl_ScanElement(string, flagPtr) const char *string;
int *flagPtr;
{ return Tcl_ScanCountedElement(string, -1, flagPtr); }


x86 assembly (clang, -O0):
<Tcl_ScanElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <Tcl_ScanCountedElement@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tcl_ScanElement>:
mov    %rsi,%rdx
mov    $0xffffffff,%esi
xor    %eax,%eax
jmp    1030 <Tcl_ScanCountedElement@plt>

LLVM IR (-O0):
define i32 @Tcl_ScanElement(i8* %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 = load i32*, i32** %4
%7 = call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @Tcl_ScanCountedElement to i32 (i8*, i32, i32*, ...)*)(i8* %5, i32 -1, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @Tcl_ScanElement(i8* %0, i32* %1) {
%3 = tail call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @Tcl_ScanCountedElement to i32 (i8*, i32, i32*, ...)*)(i8* %0, i32 -1, i32* %1)
ret i32 %3
}
long labs(long a) { return a < 0 ? -a : a; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
double f4_sum_cb_float(float (*cb)()) {
  float v = cb();
  return ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_cb_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_cb_float>:
push   %rax
xor    %eax,%eax
call   *%rdi
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_sum_cb_float(float (...)* %0) {
%2 = alloca float (...)*
%3 = alloca float
store float (...)* %0, float (...)** %2
%4 = load float (...)*, float (...)** %2
%5 = call float (...) %4()
store float %5, float* %3
%6 = load float, float* %3
%7 = fpext float %6 to double
ret double %7
}

LLVM IR (-O2):
define double @f4_sum_cb_float(float (...)* nocapture %0) {
%2 = tail call float (...) %0()
%3 = fpext float %2 to double
ret double %3
}
void quantum_double2char(double d, unsigned char *buf) {
  int i;
  unsigned char *p = (unsigned char *)&d;
  for (i = 0; i < sizeof(double); i++)
    buf[i] = p[i];
}


x86 assembly (clang, -O0):
<quantum_double2char>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x8,%rax
jae    114e <quantum_double2char+0x4e>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <quantum_double2char+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_double2char>:
movsd  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @quantum_double2char(double %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to double*
store double %0, double* %3
ret void
}
/* Type definitions */
struct radix_tree_root {
  int dummy;
};

/* Variables and functions */
int __radix_tree_insert(struct radix_tree_root *, unsigned long,
                        int /*<<< orphan*/, void *);
int radix_tree_insert(struct radix_tree_root *root, unsigned long index,
                      void *entry) {
  return __radix_tree_insert(root, index, 0, entry);
}


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

x86 assembly (clang, -O2):
<radix_tree_insert>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <__radix_tree_insert@plt>

LLVM IR (-O0):
%struct.radix_tree_root = type { i32 }
define i32 @radix_tree_insert(%struct.radix_tree_root* %0, i64 %1, i8* %2) {
%4 = alloca %struct.radix_tree_root*
%5 = alloca i64
%6 = alloca i8*
store %struct.radix_tree_root* %0, %struct.radix_tree_root** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load %struct.radix_tree_root*, %struct.radix_tree_root** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = call i32 @__radix_tree_insert(%struct.radix_tree_root* %7, i64 %8, i32 0, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.radix_tree_root = type { i32 }
define i32 @radix_tree_insert(%struct.radix_tree_root* %0, i64 %1, i8* %2) {
%4 = tail call i32 @__radix_tree_insert(%struct.radix_tree_root* %0, i64 %1, i32 0, i8* %2)
ret i32 %4
}
/* Variables and functions */
int backtrace(void **, int);
int Sys_Backtrace(void **buffer, int size) { return backtrace(buffer, size); }


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

x86 assembly (clang, -O2):
<Sys_Backtrace>:
jmp    1030 <backtrace@plt>

LLVM IR (-O0):
define i32 @Sys_Backtrace(i8** %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 = load i32, i32* %4
%7 = call i32 @backtrace(i8** %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @Sys_Backtrace(i8** %0, i32 %1) {
%3 = tail call i32 @backtrace(i8** %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double cos(double);
double d_cos(double *x) { return (cos(*x)); }


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

x86 assembly (clang, -O2):
<d_cos>:
movsd  (%rdi),%xmm0
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @d_cos(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @cos(double %2)
ret double %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_mod_inv_256v1(uint64_t r[4], uint64_t a[4]) {
  r[0] = a[1] + a[2];
  return 0;
}


x86 assembly (clang, -O0):
<mp_mod_inv_256v1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
add    0x10(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mod_inv_256v1>:
mov    0x10(%rsi),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_mod_inv_256v1(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 1
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 2
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 0
store i64 %11, i64* %13
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_mod_inv_256v1(i64* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %1, i64 2
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
store i64 %7, i64* %0
ret i64 0
}
void ldaExec() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ GL_FALSE;
GLboolean fghChangeDisplayMode(GLboolean haveToTest) { return GL_FALSE; }


x86 assembly (clang, -O0):
<fghChangeDisplayMode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@GL_FALSE = global i32 0
define i32 @fghChangeDisplayMode(i32 %0) {
%2 = load i32, i32* @GL_FALSE
ret i32 %2
}