xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ auth_add(char *, char *);
void c_add_auth(char *v1, char *v2, void *t) { auth_add(v1, v2); }


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

x86 assembly (clang, -O2):
<c_add_auth>:
jmp    1030 <auth_add@plt>

LLVM IR (-O0):
define void @c_add_auth(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 = call i32 @auth_add(i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @c_add_auth(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @auth_add(i8* %0, i8* %1)
ret void
}
int pdf_aes_final_read(void *_ctx, char *out, int len) {
  int tmplen;
  return 0;
}


x86 assembly (clang, -O0):
<pdf_aes_final_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pdf_aes_final_read(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @pdf_aes_final_read(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void tty_task_break_check(struct tty *t, char ch) {}


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

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

LLVM IR (-O0):
%struct.tty = type opaque
define void @tty_task_break_check(%struct.tty* %0, i8 signext %1) {
%3 = alloca %struct.tty*
%4 = alloca i8
store %struct.tty* %0, %struct.tty** %3
store i8 %1, i8* %4
ret void
}

LLVM IR (-O2):
%struct.tty = type opaque
define void @tty_task_break_check(%struct.tty* nocapture %0, i8 signext %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_QUICK;
int /*<<< orphan*/ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
__s32 i2c_smbus_write_quick(int file, __u8 value) {
  return i2c_smbus_access(file, value, 0, I2C_SMBUS_QUICK, 0);
}


x86 assembly (clang, -O0):
<i2c_smbus_write_quick>:
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    0x2eb5(%rip),%rax
mov    (%rax),%ecx
xor    %r8d,%r8d
mov    %r8d,%edx
call   1030 <i2c_smbus_access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_write_quick>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
xor    %r8d,%r8d
jmp    1030 <i2c_smbus_access@plt>

LLVM IR (-O0):
@I2C_SMBUS_QUICK = global i32 0
define i32 @i2c_smbus_write_quick(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 = load i32, i32* @I2C_SMBUS_QUICK
%8 = call i32 @i2c_smbus_access(i32 %5, i32 %6, i32 0, i32 %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@I2C_SMBUS_QUICK = global i32 0
define i32 @i2c_smbus_write_quick(i32 %0, i32 %1) {
%3 = load i32, i32* @I2C_SMBUS_QUICK
%4 = tail call i32 @i2c_smbus_access(i32 %0, i32 %1, i32 0, i32 %3, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void foo() {
  int i;
  char *p = (char *)&i;
  long *q = (long *)p;
  if (q == 0)
    link_error();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113a <foo+0x2a>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64*
%4 = bitcast i32* %1 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = icmp eq i64* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @link_error()
br label %11
11: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
int mod(int a, int b) { return ((a & b) + b) % b; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
and    %esi,%edi
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(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 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t FJS_Util_Min32u(uint32_t a, uint32_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<FJS_Util_Min32u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <FJS_Util_Min32u+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <FJS_Util_Min32u+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FJS_Util_Min32u>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @FJS_Util_Min32u(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ f();
main() { f(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Type definitions */
struct termp {
  int dummy;
};

/* Variables and functions */
size_t term_strlen(struct termp const *, char const *);
size_t term_tbl_strlen(const char *p, void *arg) {
  return term_strlen((const struct termp *)arg, p);
}


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

x86 assembly (clang, -O2):
<term_tbl_strlen>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <term_strlen@plt>

LLVM IR (-O0):
%struct.termp = type { i32 }
define i64 @term_tbl_strlen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.termp*
%7 = load i8*, i8** %3
%8 = call i64 @term_strlen(%struct.termp* %6, i8* %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.termp = type { i32 }
define i64 @term_tbl_strlen(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.termp*
%4 = tail call i64 @term_strlen(%struct.termp* %3, i8* %0)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int read_dat(const char *filename, char *data, int len) {
  FILE *pAMRFile = fopen(filename, "rb+");
  int size = fread(data, 1, len, pAMRFile);
  printf("aaa file size: %d \n", size);
  fclose(pAMRFile);
  return size;
}


x86 assembly (clang, -O0):
<read_dat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_dat>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xeaf(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %eax,%ebx
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"rb+\00"
@.str.1 = [20 x i8] c"aaa file size: %d \0A\00"
define i32 @read_dat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = call i32 @fread(i8* %11, i32 1, i32 %12, i32* %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32*, i32** %7
%18 = call i32 @fclose(i32* %17)
%19 = load i32, i32* %8
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"rb+\00"
@.str.1 = [20 x i8] c"aaa file size: %d \0A\00"
define i32 @read_dat(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fread(i8* %1, i32 1, i32 %2, i32* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @fclose(i32* %4)
ret i32 %5
}
int summation(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<summation>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @summation(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @summation(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void vec3_iadd(float a[3], const float b[3]) { vec3_add(a, b, a); }


x86 assembly (clang, -O0):
<vec3_iadd>:
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    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <vec3_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_iadd>:
mov    %rdi,%rdx
xor    %eax,%eax
jmp    1030 <vec3_add@plt>

LLVM IR (-O0):
define void @vec3_iadd(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = load float*, float** %3
%8 = call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @vec3_add to i32 (float*, float*, float*, ...)*)(float* %5, float* %6, float* %7)
ret void
}

LLVM IR (-O2):
define void @vec3_iadd(float* %0, float* %1) {
%3 = tail call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @vec3_add to i32 (float*, float*, float*, ...)*)(float* %0, float* %1, float* %0)
ret void
}
void usb_nop_xceiv_unregister(void) {}


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

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

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

LLVM IR (-O2):
define void @usb_nop_xceiv_unregister() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct zbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
int /*<<< orphan*/ zbuf_get32(struct zbuf *);
uint32_t zbuf_get_be32(struct zbuf *zb) { return be32toh(zbuf_get32(zb)); }


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

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

LLVM IR (-O0):
%struct.zbuf = type { i32 }
define i32 @zbuf_get_be32(%struct.zbuf* %0) {
%2 = alloca %struct.zbuf*
store %struct.zbuf* %0, %struct.zbuf** %2
%3 = load %struct.zbuf*, %struct.zbuf** %2
%4 = call i32 @zbuf_get32(%struct.zbuf* %3)
%5 = call i32 @be32toh(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.zbuf = type { i32 }
define i32 @zbuf_get_be32(%struct.zbuf* %0) {
%2 = tail call i32 @zbuf_get32(%struct.zbuf* %0)
%3 = tail call i32 @be32toh(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dssumors(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dssumors(N, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_dssumors@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dssumors@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dssumors(i32 %6, float* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dssumors(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void lock_init(struct lock *lock) {}


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

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

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

LLVM IR (-O2):
%struct.lock = type opaque
define void @lock_init(%struct.lock* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_stats();
int /*<<< orphan*/ test_containers();
int /*<<< orphan*/ test_utils();
int main() {
  test_containers();
  test_utils();
  print_stats();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_containers@plt>
mov    $0x0,%al
call   1040 <test_utils@plt>
mov    $0x0,%al
call   1030 <print_stats@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_containers@plt>
xor    %eax,%eax
call   1040 <test_utils@plt>
xor    %eax,%eax
call   1030 <print_stats@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_containers()
%2 = call i32 (...) @test_utils()
%3 = call i32 (...) @print_stats()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_containers()
%2 = tail call i32 (...) @test_utils()
%3 = tail call i32 (...) @print_stats()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t reverse_u32(uint32_t v) {
  uint32_t r;
  r = v >> 24;
  r += v << 24;
  r += (v >> 8) & 0xFF00;
  r += (v << 8) & 0xFF0000;
  return r;
}


x86 assembly (clang, -O0):
<reverse_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff00,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_u32>:
mov    %edi,%eax
sar    $0x18,%eax
mov    %edi,%ecx
shl    $0x18,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x8,%eax
and    $0xff00,%eax
add    %ecx,%eax
shl    $0x8,%edi
and    $0xff0000,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @reverse_u32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 24
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 %6, 24
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = ashr i32 %10, 8
%12 = and i32 %11, 65280
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = shl i32 %15, 8
%17 = and i32 %16, 16711680
%18 = load i32, i32* %3
%19 = add nsw i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @reverse_u32(i32 %0) {
%2 = ashr i32 %0, 24
%3 = shl i32 %0, 24
%4 = add nsw i32 %2, %3
%5 = lshr i32 %0, 8
%6 = and i32 %5, 65280
%7 = add nsw i32 %4, %6
%8 = shl i32 %0, 8
%9 = and i32 %8, 16711680
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void problemUsage() { printf("   -z size of strings (default: 10)\n"); }


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c" -z size of strings (default: 10)\00"
define void @problemUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_sata_ssdlog(int);
int get_sata_ssd_wear(int fd) {
  char *ssdlog = NULL;
  int wear = 255;
  ssdlog = get_sata_ssdlog(fd);
  if (ssdlog != NULL) {
    wear = ssdlog[8];
    free(ssdlog);
  }
  return wear;
}


x86 assembly (clang, -O0):
<get_sata_ssd_wear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0xff,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_sata_ssdlog@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <get_sata_ssd_wear+0x45>
mov    -0x10(%rbp),%rax
movsbl 0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sata_ssd_wear>:
push   %rbx
call   1040 <get_sata_ssdlog@plt>
test   %rax,%rax
je     1139 <get_sata_ssd_wear+0x19>
movsbl 0x8(%rax),%ebx
mov    %rax,%rdi
call   1030 <free@plt>
jmp    113e <get_sata_ssd_wear+0x1e>
mov    $0xff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_sata_ssd_wear(i32 %0) {
%2 = tail call i8* @get_sata_ssdlog(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 8
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i32 @free(i8* %2)
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ %7, %4 ], [ 255, %1 ]
ret i32 %10
}
/* Variables and functions */
int O_ACCMODE;
int S_IRUSR;
int S_IWUSR;
int __gen_tempname(char *, int /*<<< orphan*/, int, int /*<<< orphan*/, int);
int mkostemp(char *template, int flags) {
  flags -= flags & O_ACCMODE;
  return __gen_tempname(template, 0, flags, 0, S_IRUSR | S_IWUSR);
}


x86 assembly (clang, -O0):
<mkostemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2ec7(%rip),%rax
and    (%rax),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2e8f(%rip),%rax
mov    (%rax),%r8d
mov    0x2e95(%rip),%rax
or     (%rax),%r8d
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <__gen_tempname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkostemp>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edx
not    %edx
and    %esi,%edx
mov    0x2eac(%rip),%rax
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%r8d
or     (%rax),%r8d
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <__gen_tempname@plt>

LLVM IR (-O0):
@O_ACCMODE = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @O_ACCMODE
%7 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %4
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = load i32, i32* @S_IRUSR
%13 = load i32, i32* @S_IWUSR
%14 = or i32 %12, %13
%15 = call i32 @__gen_tempname(i8* %10, i32 0, i32 %11, i32 0, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@O_ACCMODE = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = load i32, i32* @O_ACCMODE
%4 = xor i32 %3, -1
%5 = and i32 %4, %1
%6 = load i32, i32* @S_IRUSR
%7 = load i32, i32* @S_IWUSR
%8 = or i32 %7, %6
%9 = tail call i32 @__gen_tempname(i8* %0, i32 0, i32 %5, i32 0, i32 %8)
ret i32 %9
}
/* Variables and functions */
double sigmoid_element(double);
double sigmoid_prime_element(double element) {
  double sig = sigmoid_element(element);
  return sig * (1 - sig);
}


x86 assembly (clang, -O0):
<sigmoid_prime_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sigmoid_element@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid_prime_element>:
push   %rax
call   1030 <sigmoid_element@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid_prime_element(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @sigmoid_element(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @sigmoid_prime_element(double %0) {
%2 = tail call double @sigmoid_element(double %0)
%3 = fsub double 1.000000e+00, %2
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
scalar_t__ GJrealloc(char *, int);
char *GJremovechar(char *, char);
char *strcat(char *, char *);
int strlen(char *);
char *GJstrappend(char *string1, char *string2) {
  char *ret_val;
  ret_val = GJremovechar(string1, '\n');
  ret_val = (char *)GJrealloc(
      ret_val, sizeof(char) * (strlen(ret_val) + strlen(string2) + 1));
  ret_val = strcat(ret_val, string2);
  return ret_val;
}


x86 assembly (clang, -O0):
<GJstrappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <GJremovechar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   1050 <GJrealloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GJstrappend>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    $0xa,%esi
call   1030 <GJremovechar@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%esi
add    $0x1,%esi
mov    %rbx,%rdi
call   1050 <GJrealloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
define i8* @GJstrappend(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @GJremovechar(i8* %6, i8 signext 10)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = add nsw i32 %10, %12
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = mul i64 1, %15
%17 = trunc i64 %16 to i32
%18 = call i64 @GJrealloc(i8* %8, i32 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %5
%20 = load i8*, i8** %5
%21 = load i8*, i8** %4
%22 = call i8* @strcat(i8* %20, i8* %21)
store i8* %22, i8** %5
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @GJstrappend(i8* %0, i8* %1) {
%3 = tail call i8* @GJremovechar(i8* %0, i8 signext 10)
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i32 @strlen(i8* %1)
%6 = add i32 %4, 1
%7 = add i32 %6, %5
%8 = tail call i64 @GJrealloc(i8* %3, i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i8* @strcat(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
ret i8* %9
}
int expozero(short int *exp) { return ((exp[0] == 0) ? 1 : 0); }


x86 assembly (clang, -O0):
<expozero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<expozero>:
xor    %eax,%eax
cmpw   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @expozero(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 0
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @expozero(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int usb_connected(void) { return (*(volatile unsigned long *)0x800031c0) & 1; }


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

x86 assembly (clang, -O2):
<usb_connected>:
mov    $0x800031c0,%eax
mov    (%rax),%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @usb_connected() {
%1 = load volatile i64, i64* inttoptr (i64 2147496384 to i64*)
%2 = and i64 %1, 1
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @usb_connected() {
%1 = load volatile i64, i64* inttoptr (i64 2147496384 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 1
ret i32 %3
}
int rec1(int i) {
  if (i <= 0)
    return 0;
  return rec1(rec1(rec1(i - 2) - 1)) + 1;
}


x86 assembly (clang, -O0):
<rec1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <rec1+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1153 <rec1+0x43>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <rec1@plt>
mov    %eax,%edi
sub    $0x1,%edi
call   1030 <rec1@plt>
mov    %eax,%edi
call   1030 <rec1@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec1>:
push   %rbx
test   %edi,%edi
jle    113b <rec1+0x2b>
mov    %edi,%eax
xor    %ebx,%ebx
nopl   0x0(%rax)
add    $0xfffffffe,%eax
mov    %eax,%edi
call   1030 <rec1@plt>
lea    -0x1(%rax),%edi
call   1030 <rec1@plt>
add    $0x1,%ebx
test   %eax,%eax
jg     1120 <rec1+0x10>
jmp    113d <rec1+0x2d>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rec1(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @rec1(i32 %6)
%8 = add nsw i32 %7, -1
%9 = tail call i32 @rec1(i32 %8)
%10 = add nuw nsw i32 %5, 1
%11 = icmp slt i32 %9, 1
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %13
}
int ExtractI4(unsigned char *buf) {
  int x;
  x = buf[0];
  x <<= 8;
  x |= buf[1];
  x <<= 8;
  x |= buf[2];
  x <<= 8;
  x |= buf[3];
  return x;
}


x86 assembly (clang, -O0):
<ExtractI4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtractI4>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @ExtractI4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = shl i32 %16, 8
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = shl i32 %24, 8
store i32 %25, i32* %3
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i32, i32* %3
%31 = or i32 %30, %29
store i32 %31, i32* %3
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @ExtractI4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %3, 16
%8 = shl nuw nsw i32 %6, 8
%9 = or i32 %8, %7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = shl nuw i32 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int do_540() { return 540; }


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

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

LLVM IR (-O0):
define i32 @do_540() {
ret i32 540
}

LLVM IR (-O2):
define i32 @do_540() {
ret i32 540
}
/* Variables and functions */
int /*<<< orphan*/ SPI_MAX7221_EnableRxInt();
int /*<<< orphan*/ SPI_MAX7221_EnableTxInt();
void SPI_MAX7221_EnableInt(void) {
  SPI_MAX7221_EnableRxInt();
  SPI_MAX7221_EnableTxInt();
}


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

x86 assembly (clang, -O2):
<SPI_MAX7221_EnableInt>:
push   %rax
xor    %eax,%eax
call   1040 <SPI_MAX7221_EnableRxInt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SPI_MAX7221_EnableTxInt@plt>

LLVM IR (-O0):
define void @SPI_MAX7221_EnableInt() {
%1 = call i32 (...) @SPI_MAX7221_EnableRxInt()
%2 = call i32 (...) @SPI_MAX7221_EnableTxInt()
ret void
}

LLVM IR (-O2):
define void @SPI_MAX7221_EnableInt() {
%1 = tail call i32 (...) @SPI_MAX7221_EnableRxInt()
%2 = tail call i32 (...) @SPI_MAX7221_EnableTxInt()
ret void
}
int length(char string[]) {
  int index;
  for (index = 0; string[index] != '\0'; ++index)
    return (index);
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     112a <length+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @length(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %18
15: ; No predecessors!
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %13, %5
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @length(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void RFCAL_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @RFCAL_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @RFCAL_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
int max2(int a, int b) { return a < b ? b : a; }


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

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

LLVM IR (-O0):
define i32 @max2(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
int test_prefix_incdec(int i) {
  __emit_expression_range(0, ++i);
  __emit_expression_range(0, --i);
}


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

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

LLVM IR (-O0):
define i32 @test_prefix_incdec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = call i32 @__emit_expression_range(i32 0, i32 %5)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, -1
store i32 %8, i32* %3
%9 = call i32 @__emit_expression_range(i32 0, i32 %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_prefix_incdec(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @__emit_expression_range(i32 0, i32 %2)
%4 = tail call i32 @__emit_expression_range(i32 0, i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() { printf("o valor do numero e': %4.2f", 1.0f / 3.0f); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee9(%rip),%rdi
movss  0xedd(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"o valor do numero e': %4.2f\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float 0x3FD5555560000000)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"o valor do numero e': %4.2f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float 0x3FD5555560000000)
ret i32 0
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ push(struct node **, int);
int rand();
struct node *randList(int n) {
  struct node *head = NULL;
  for (int i = 0; i < n; i++) {
    push(&head, rand() % 20);
  }
  return head;
}


x86 assembly (clang, -O0):
<randList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116e <randList+0x4e>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    -0x10(%rbp),%rdi
call   1030 <push@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <randList+0x1a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randList>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
test   %edi,%edi
jle    1179 <randList+0x59>
mov    %edi,%ebx
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
mov    %r14,%rdi
call   1030 <push@plt>
add    $0xffffffff,%ebx
jne    1140 <randList+0x20>
mov    (%rsp),%rax
jmp    117b <randList+0x5b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @randList(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.node*
%4 = alloca i32
store i32 %0, i32* %2
store %struct.node* null, %struct.node** %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 20
%12 = call i32 @push(%struct.node** %3, i32 %11)
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load %struct.node*, %struct.node** %3
ret %struct.node* %17
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @randList(i32 %0) {
%2 = alloca %struct.node*
%3 = bitcast %struct.node** %2 to i8*
store %struct.node* null, %struct.node** %2
%4 = icmp sgt i32 %0, 0
br i1 %4, label %9, label %7
5: ; preds = %9
%6 = load %struct.node*, %struct.node** %2
br label %7
7: ; preds = %5, %1
%8 = phi %struct.node* [ %6, %5 ], [ null, %1 ]
ret %struct.node* %8
9: ; preds = %1, %9
%10 = phi i32 [ %14, %9 ], [ 0, %1 ]
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 20
%13 = call i32 @push(%struct.node** %2, i32 %12)
%14 = add nuw nsw i32 %10, 1
%15 = icmp eq i32 %14, %0
br i1 %15, label %5, label %9
}
/* Variables and functions */
int /*<<< orphan*/ zwave_sendClassCommand(unsigned int, int, int,
                                          unsigned char *, int);
void zwavecmd_association_remove_all(unsigned int id, unsigned int group) {
  unsigned char buf[255];
  buf[0] = group;
  zwave_sendClassCommand(id, 0x85, 0x4, buf, 1);
}


x86 assembly (clang, -O0):
<zwavecmd_association_remove_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x110(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rcx
mov    $0x85,%esi
mov    $0x4,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_association_remove_all>:
sub    $0x108,%rsp
mov    %sil,(%rsp)
mov    %rsp,%rcx
mov    $0x85,%esi
mov    $0x4,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @zwavecmd_association_remove_all(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [255 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @zwave_sendClassCommand(i32 %9, i32 133, i32 4, i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @zwavecmd_association_remove_all(i32 %0, i32 %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = call i32 @zwave_sendClassCommand(i32 %0, i32 133, i32 4, i8* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, int /*<<< orphan*/);
int /*<<< orphan*/ ubitmap_get_octets_len(size_t);
void ubitmap_set_all(void *b, size_t len) {
  memset(b, 1, ubitmap_get_octets_len(len));
}


x86 assembly (clang, -O0):
<ubitmap_set_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ubitmap_get_octets_len@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    $0x1,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubitmap_set_all>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <ubitmap_get_octets_len@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @ubitmap_set_all(i8* %0, i64 %1) {
%3 = tail call i32 @ubitmap_get_octets_len(i64 %1)
%4 = tail call i32 @memset(i8* %0, i32 1, i32 %3)
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_range_unshare(struct __test_metadata *);
void wrapper_close_range_unshare(struct __test_metadata *_metadata,
                                 struct __fixture_variant_metadata *variant) {
  close_range_unshare(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_close_range_unshare>:
jmp    1030 <close_range_unshare@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range_unshare(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @close_range_unshare(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range_unshare(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @close_range_unshare(%struct.__test_metadata* %0)
ret void
}