xunge/DecIR huggingface dataset:
/* Type definitions */
struct user {
  int dummy;
};

/* Variables and functions */
struct user *user_find(char *);
struct user *user_new(char *);
struct user *user_get(char *prefix) {
  struct user *user;
  user = user_find(prefix);
  return user ? user : user_new(prefix);
}


x86 assembly (clang, -O0):
<user_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <user_find@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <user_get+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115e <user_get+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <user_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_get>:
push   %rbx
mov    %rdi,%rbx
call   1040 <user_find@plt>
test   %rax,%rax
je     1130 <user_get+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <user_new@plt>

LLVM IR (-O0):
%struct.user = type { i32 }
define %struct.user* @user_get(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.user*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.user* @user_find(i8* %4)
store %struct.user* %5, %struct.user** %3
%6 = load %struct.user*, %struct.user** %3
%7 = icmp ne %struct.user* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load %struct.user*, %struct.user** %3
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call %struct.user* @user_new(i8* %11)
br label %13
13: ; preds = %10, %8
%14 = phi %struct.user* [ %9, %8 ], [ %12, %10 ]
ret %struct.user* %14
}

LLVM IR (-O2):
%struct.user = type { i32 }
define %struct.user* @user_get(i8* %0) {
%2 = tail call %struct.user* @user_find(i8* %0)
%3 = icmp eq %struct.user* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.user* @user_new(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi %struct.user* [ %5, %4 ], [ %2, %1 ]
ret %struct.user* %7
}
/* Variables and functions */
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ float_to_bignum(int /*<<< orphan*/);
int /*<<< orphan*/ tag_bignum(int /*<<< orphan*/);
void primitive_float_to_bignum(void) {
  drepl(tag_bignum(float_to_bignum(dpeek())));
}


x86 assembly (clang, -O0):
<primitive_float_to_bignum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <float_to_bignum@plt>
mov    %eax,%edi
call   1060 <tag_bignum@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_to_bignum>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <float_to_bignum@plt>
mov    %eax,%edi
call   1060 <tag_bignum@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_float_to_bignum() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @float_to_bignum(i32 %1)
%3 = call i32 @tag_bignum(i32 %2)
%4 = call i32 @drepl(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_float_to_bignum() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @float_to_bignum(i32 %1)
%3 = tail call i32 @tag_bignum(i32 %2)
%4 = tail call i32 @drepl(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int /*<<< orphan*/);
ssize_t myread_swift_tcmalloc(int fd, void *buf, size_t len) {
  return recv(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<myread_swift_tcmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myread_swift_tcmalloc>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @myread_swift_tcmalloc(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int FACOM_run(int /*<<< orphan*/);
int FACOM_stop(void) { return FACOM_run(0); }


x86 assembly (clang, -O0):
<FACOM_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <FACOM_run@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FACOM_stop>:
xor    %edi,%edi
jmp    1030 <FACOM_run@plt>

LLVM IR (-O0):
define i32 @FACOM_stop() {
%1 = call i32 @FACOM_run(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @FACOM_stop() {
%1 = tail call i32 @FACOM_run(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
size_t memscpy(void *dest, size_t dst_size, const void *src, size_t src_size) {
  size_t copy_size = dst_size < src_size ? dst_size : src_size;
  memcpy(dest, src, copy_size);
  return copy_size;
}


x86 assembly (clang, -O0):
<memscpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1143 <memscpy+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    114b <memscpy+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memscpy>:
push   %rbx
mov    %rcx,%rbx
cmp    %rcx,%rsi
cmovb  %rsi,%rbx
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @memscpy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp ult i64 %1, %3
%6 = select i1 %5, i64 %1, i64 %3
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %6)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ ccndc_fatal(int, char *, int, char const *);
void on_error_exit(int res, int lineno, const char *msg) {
  if (res >= 0)
    return;
  ccndc_fatal(lineno, "fatal error, res = %d, %s\n", res, msg);
}


x86 assembly (clang, -O0):
<on_error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1131 <on_error_exit+0x21>
jmp    1147 <on_error_exit+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xebe(%rip),%rsi
call   1030 <ccndc_fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_error_exit>:
test   %edi,%edi
js     1115 <on_error_exit+0x5>
ret
mov    %rdx,%rcx
mov    %edi,%edx
lea    0xedf(%rip),%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <ccndc_fatal@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"fatal error, res = %d, %s\0A\00"
define void @on_error_exit(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %15
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i8*, i8** %6
%14 = call i32 @ccndc_fatal(i32 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
br label %15
15: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"fatal error, res = %d, %s\0A\00"
define void @on_error_exit(i32 %0, i32 %1, i8* %2) {
%4 = icmp sgt i32 %0, -1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @ccndc_fatal(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %2)
br label %7
7: ; preds = %3, %5
ret void
}
void process_elf64(struct zeus_elf_file *elf) {}


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

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

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

LLVM IR (-O2):
%struct.zeus_elf_file = type opaque
define void @process_elf64(%struct.zeus_elf_file* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  for (int i = 0; i < 3; i++) {
    printf("cough\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"cough\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *where(char *conds) {
  const char *where = " WHERE ";
  char *result = (char *)malloc(strlen(where) + strlen(conds) + 1);
  strcpy(result, where);
  strcat(result, conds);
  free(conds);
  return result;
}


x86 assembly (clang, -O0):
<where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<where>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x8(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe91(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c" WHERE \00"
define i8* @where(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %6, %8
%10 = add nsw i64 %9, 1
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %2
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
@.str = [8 x i8] c" WHERE \00"
define i8* @where(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 8
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %5, i8* %0)
%8 = tail call i32 @free(i8* %0)
ret i8* %5
}
char *fo_scheduler_current() { return (0); }


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

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

LLVM IR (-O0):
define i8* @fo_scheduler_current() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @fo_scheduler_current() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *s) {
  int i;
  if (s) {
    i = 0;
    while (s[i]) {
      ft_putchar(s[i++]);
    }
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <ft_putstr+0x55>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1160 <ft_putstr+0x50>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    112e <ft_putstr+0x1e>
jmp    1165 <ft_putstr+0x55>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putstr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putstr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8 [ %12, %6 ], [ %4, %3 ]
%9 = add nuw i64 %7, 1
%10 = tail call i32 @ft_putchar(i8 signext %8)
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
main() {
  __attribute__((vector_size(8))) int c;
  __attribute__((vector_size(8))) int a = {1, -1};
  __attribute__((vector_size(8))) int b = {2, -2};
  c = -a + b * b * (-1LL);
  printf("result is %llx\n", (long long)c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movabs $0xffffffff00000001,%rax
ff ff ff
mov    %rax,-0x10(%rbp)
movabs $0xfffffffe00000002,%rax
ff ff ff
mov    %rax,-0x18(%rbp)
movq   -0x10(%rbp),%xmm2
movq   -0x18(%rbp),%xmm0
movaps %xmm0,%xmm1
pmuludq %xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm0
pmuludq %xmm0,%xmm0
punpckldq %xmm0,%xmm1
xorps  %xmm0,%xmm0
paddd  %xmm2,%xmm1
psubd  %xmm1,%xmm0
movq   %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
movabs $0xfffffffdfffffffb,%rsi
ff ff ff
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"result is %llx\0A\00"
define i32 @main() {
%1 = alloca <2 x i32>
%2 = alloca <2 x i32>
%3 = alloca <2 x i32>
store <2 x i32> <i32 1, i32 -1>, <2 x i32>* %2
store <2 x i32> <i32 2, i32 -2>, <2 x i32>* %3
%4 = load <2 x i32>, <2 x i32>* %2
%5 = sub <2 x i32> zeroinitializer, %4
%6 = load <2 x i32>, <2 x i32>* %3
%7 = load <2 x i32>, <2 x i32>* %3
%8 = mul <2 x i32> %6, %7
%9 = mul <2 x i32> %8, <i32 -1, i32 -1>
%10 = add <2 x i32> %5, %9
store <2 x i32> %10, <2 x i32>* %1
%11 = load <2 x i32>, <2 x i32>* %1
%12 = bitcast <2 x i32> %11 to i64
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"result is %llx\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 -8589934597)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_prompt() { printf("db > "); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"db > \00"
define void @print_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *compare_uchar_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_uchar_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_uchar_context() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void testMachineRightShift() {
  int a = -32;
  int b = a >> 1;
  printf("a = %d, b = %d\n", a, b);
}


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

x86 assembly (clang, -O2):
<testMachineRightShift>:
lea    0xee9(%rip),%rdi
mov    $0xffffffe0,%esi
mov    $0xfffffff0,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define void @testMachineRightShift() {
%1 = alloca i32
%2 = alloca i32
store i32 -32, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define void @testMachineRightShift() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 -32, i32 -16)
ret void
}
int entry_isprotected(unsigned long entry) { return (entry & 0x200) == 0x200; }


x86 assembly (clang, -O0):
<entry_isprotected>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x200,%rax
cmp    $0x200,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry_isprotected>:
mov    %rdi,%rax
shr    $0x9,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @entry_isprotected(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 512
%5 = icmp eq i64 %4, 512
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @entry_isprotected(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 9
%4 = and i32 %3, 1
ret i32 %4
}
int (*(*test26(foo))())() long foo;
{}


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

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

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

LLVM IR (-O2):
define noalias i32 (...)* (...)* @test26(i64 %0) {
ret i32 (...)* (...)* undef
}
void XeviQueryExtension() {}


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

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

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

LLVM IR (-O2):
define void @XeviQueryExtension() {
ret void
}
int len(int arr[]) {
  int l;
  l = sizeof(arr) / sizeof(arr[0]);
  return l;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @len(i32* nocapture readnone %0) {
ret i32 2
}
int isalpha(int ch) {
  return (((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z')));
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void g_slist_position() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_position() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intToString(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int num = 341234;
  char output[4];
  intToString(output, num);
  printf("int is = %s", output);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x534f2,%esi
call   1040 <intToString@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"int is = %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 0, i32* %1
store i32 341234, i32* %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @intToString(i8* %4, i32 %5)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"int is = %s\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @intToString(i8* %2, i32 341234)
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int intcomp(const void *a, const void *b) {
  return (*(int *)a <= *(int *)b ? -1 : 1);
}


x86 assembly (clang, -O0):
<intcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovle %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcomp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @intcomp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sle i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @intcomp(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 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
int ft_is_prime(int nb) {
  int i;
  i = 2;
  if (nb <= 1)
    return (0);
  if (nb == 2 || nb == 3)
    return (1);
  while (i * i <= nb) {
    if (nb % i == 0)
      return (0);
    i++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1124 <ft_is_prime+0x24>
movl   $0x0,-0x4(%rbp)
jmp    118a <ft_is_prime+0x8a>
cmpl   $0x2,-0x8(%rbp)
je     1138 <ft_is_prime+0x38>
cmpl   $0x3,-0x8(%rbp)
jne    1144 <ft_is_prime+0x44>
movl   $0x1,-0x4(%rbp)
jmp    118a <ft_is_prime+0x8a>
jmp    1149 <ft_is_prime+0x49>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1183 <ft_is_prime+0x83>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1175 <ft_is_prime+0x75>
movl   $0x0,-0x4(%rbp)
jmp    118a <ft_is_prime+0x8a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <ft_is_prime+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <ft_is_prime+0xa>
mov    %ecx,%eax
ret
cmp    $0x4,%edi
jae    1115 <ft_is_prime+0x15>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <ft_is_prime+0x7>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1120 <ft_is_prime+0x20>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ft_is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %32
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11, %8
store i32 1, i32* %2
br label %32
15: ; preds = %11
br label %16
16: ; preds = %28, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %4
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %3
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %31
22: ; preds = %16
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = srem i32 %23, %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 0, i32* %2
br label %32
28: ; preds = %22
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %16
31: ; preds = %16
store i32 1, i32* %2
br label %32
32: ; preds = %31, %27, %14, %7
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @ft_is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = mul nsw i32 %12, %12
%7 = icmp sgt i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %12, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %8 ], [ 1, %5 ]
ret i32 %14
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ echochar(char);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_echochar(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_return(echochar(args[0][0]));
}


x86 assembly (clang, -O0):
<cmd_echochar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    116a <cmd_echochar+0x2a>
jmp    118a <cmd_echochar+0x4a>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1060 <echochar@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_echochar>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1155 <cmd_echochar+0x15>
pop    %rbx
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    (%rbx),%rax
movsbl (%rax),%edi
call   1060 <echochar@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <report_return@plt>

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

LLVM IR (-O2):
define void @cmd_echochar(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = load i8*, i8** %1
%8 = load i8, i8* %7
%9 = tail call i32 @echochar(i8 signext %8)
%10 = tail call i32 @report_return(i32 %9)
br label %11
11: ; preds = %2, %5
ret void
}
unsigned our_inet_addr(cp)
char const *cp;
{ return inet_addr(cp); }


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

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

LLVM IR (-O0):
define i32 @our_inet_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @inet_addr to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @our_inet_addr(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @inet_addr to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
unsigned int test_1(unsigned int x, unsigned int y) { return x & ~(1 << y); }


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_1(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_1(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
char *numeric_dec_to_hex(long long int number) { return ""; }


x86 assembly (clang, -O0):
<numeric_dec_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_dec_to_hex(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_dec_to_hex(i64 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double fmal(long double x, long double y, long double z) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<fmal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %4
}
/* Variables and functions */
void free(void *);
void *malloc(size_t);
void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)) {
  if (m != NULL)
    *m = malloc;
  if (f != NULL)
    *f = free;
}


x86 assembly (clang, -O0):
<CRYPTO_get_locked_mem_functions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <CRYPTO_get_locked_mem_functions+0x25>
mov    -0x8(%rbp),%rax
mov    0x2ec6(%rip),%rcx
mov    %rcx,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <CRYPTO_get_locked_mem_functions+0x3e>
mov    -0x10(%rbp),%rax
mov    0x2e95(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_get_locked_mem_functions>:
test   %rdi,%rdi
je     110f <CRYPTO_get_locked_mem_functions+0xf>
mov    0x2edc(%rip),%rax
mov    %rax,(%rdi)
test   %rsi,%rsi
je     111e <CRYPTO_get_locked_mem_functions+0x1e>
mov    0x2eb5(%rip),%rax
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @CRYPTO_get_locked_mem_functions(i8* (i64)** writeonly %0, void (i8*)** writeonly %1) {
%3 = icmp eq i8* (i64)** %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i8* (i64)* @malloc, i8* (i64)** %0
br label %5
5: ; preds = %4, %2
%6 = icmp eq void (i8*)** %1, null
br i1 %6, label %8, label %7
7: ; preds = %5
store void (i8*)* @free, void (i8*)** %1
br label %8
8: ; preds = %7, %5
ret void
}
/* Variables and functions */
int getchar();
int k_keyin(void) { return getchar(); }


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

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

LLVM IR (-O0):
define i32 @k_keyin() {
%1 = call i32 (...) @getchar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @k_keyin() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void *dlsym(void *handle, const char *symbol) {
  printk("Write dlsym()\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<dlsym>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Write dlsym()\0A\00"
define noalias i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
long lswap4(long);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
long read_blk2link(unsigned char *datablk) {
  long link;
  memmove((unsigned char *)&link, datablk + 3, sizeof(long));
  return lswap4(link);
}


x86 assembly (clang, -O0):
<read_blk2link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    $0x8,%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rdi
call   1030 <lswap4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_blk2link>:
push   %rax
lea    0x3(%rdi),%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1040 <memmove@plt>
mov    (%rsp),%rdi
call   1030 <lswap4@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @read_blk2link(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = bitcast i64* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 3
%7 = call i32 @memmove(i8* %4, i8* %6, i32 8)
%8 = load i64, i64* %3
%9 = call i64 @lswap4(i64 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @read_blk2link(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 3
%5 = call i32 @memmove(i8* %3, i8* %4, i32 8)
%6 = load i64, i64* %2
%7 = call i64 @lswap4(i64 %6)
ret i64 %7
}
void str_replaceChar(char *pStr, char c1, char c2) {
  while (*pStr) {
    if (*pStr == c1)
      *pStr = c2;
    ++pStr;
  }
}


x86 assembly (clang, -O0):
<str_replaceChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <str_replaceChar+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <str_replaceChar+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <str_replaceChar+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_replaceChar>:
mov    (%rdi),%al
test   %al,%al
je     1125 <str_replaceChar+0x25>
add    $0x1,%rdi
jmp    111b <str_replaceChar+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <str_replaceChar+0x25>
cmp    %sil,%al
jne    1110 <str_replaceChar+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <str_replaceChar+0x10>
ret

LLVM IR (-O0):
define void @str_replaceChar(i8* %0, i8 signext %1, i8 signext %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
br label %7
7: ; preds = %21, %3
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i8, i8* %6
%20 = load i8*, i8** %4
store i8 %19, i8* %20
br label %21
21: ; preds = %18, %11
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @str_replaceChar(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ strlcat(char *, char *, int);
int /*<<< orphan*/ strlcpy(char *, char *, int);
void f11() {
  char a[256], b[256];
  strlcpy(a, "world", sizeof(a));
  strlcpy(b, "hello ", sizeof(b));
  strlcat(b, a, sizeof(b));
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x100,%edx
call   1040 <strlcpy@plt>
lea    -0x200(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x100,%edx
call   1040 <strlcpy@plt>
lea    -0x200(%rbp),%rdi
lea    -0x100(%rbp),%rsi
mov    $0x100,%edx
call   1030 <strlcat@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
push   %r14
push   %rbx
sub    $0x208,%rsp
lea    0xecf(%rip),%rsi
lea    0x100(%rsp),%r14
mov    %r14,%rdi
mov    $0x100,%edx
call   1040 <strlcpy@plt>
lea    0xeb9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%edx
call   1040 <strlcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x100,%edx
call   1030 <strlcat@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"world\00"
@.str.1 = [7 x i8] c"hello \00"
define void @f11() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @strlcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 256)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlcpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 256)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%9 = call i32 @strlcat(i8* %7, i8* %8, i32 256)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
@.str.1 = [7 x i8] c"hello \00"
define void @f11() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 256)
%6 = call i32 @strlcpy(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 256)
%7 = call i32 @strlcat(i8* %4, i8* %3, i32 256)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
void restorede(void) { ol("ld\tde,(saved_de)"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"ld\09de,(saved_de)\00"
define void @restorede() {
%1 = call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ld\09de,(saved_de)\00"
define void @restorede() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_processes(char *);
int main() {
  read_processes("/proc");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <read_processes@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/proc\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @read_processes(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"/proc\00"
define i32 @main() {
%1 = tail call i32 @read_processes(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ init_curses();
scalar_t__ load_config(char *);
int main() {
  if (load_config("config")) {
    init_curses();
    cleanup();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <load_config@plt>
cmp    $0x0,%rax
je     1163 <main+0x33>
mov    $0x0,%al
call   1030 <init_curses@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <load_config@plt>
test   %rax,%rax
je     1150 <main+0x20>
xor    %eax,%eax
call   1030 <init_curses@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"config\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @load_config(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 (...) @init_curses()
%6 = call i32 (...) @cleanup()
br label %7
7: ; preds = %4, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [7 x i8] c"config\00"
define i32 @main() {
%1 = tail call i64 @load_config(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @init_curses()
%5 = tail call i32 (...) @cleanup()
br label %6
6: ; preds = %3, %0
ret i32 0
}