xunge/DecIR huggingface dataset:
double compute_midpoint(double coord_1, double coord_2) {
  double midpoint = 0.0;
  midpoint = (coord_1 + coord_2) / 2;
  return midpoint;
}


x86 assembly (clang, -O0):
<compute_midpoint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_midpoint>:
addsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @compute_midpoint(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = fdiv double %8, 2.000000e+00
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @compute_midpoint(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 5.000000e-01
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
int vprintf(char const *, int /*<<< orphan*/);
void safe_vprintf(const char *format, va_list ap) {
  int res = vprintf(format, ap);
  if (res < 0) {
    perror("vprintf()");
    abort();
  }
}


x86 assembly (clang, -O0):
<safe_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <vprintf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    116b <safe_vprintf+0x3b>
lea    0xea1(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_vprintf>:
push   %rax
call   1040 <vprintf@plt>
test   %eax,%eax
js     113c <safe_vprintf+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"vprintf()\00"
define void @safe_vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret void
}
int test_imm_FBuint32_mem(unsigned int *val) {
  return ((*val) & (0xFB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FBuint32_mem>:
testb  $0xfb,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FBuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 251
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
f(double x) { double y; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(double %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ radeon_i2c_monitor(int, int);
void radeon_i2c_monitor_default(void) { radeon_i2c_monitor(0x7E5C, 0x7E58); }


x86 assembly (clang, -O0):
<radeon_i2c_monitor_default>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e5c,%edi
mov    $0x7e58,%esi
call   1030 <radeon_i2c_monitor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<radeon_i2c_monitor_default>:
mov    $0x7e5c,%edi
mov    $0x7e58,%esi
jmp    1030 <radeon_i2c_monitor@plt>

LLVM IR (-O0):
define void @radeon_i2c_monitor_default() {
%1 = call i32 @radeon_i2c_monitor(i32 32348, i32 32344)
ret void
}

LLVM IR (-O2):
define void @radeon_i2c_monitor_default() {
%1 = tail call i32 @radeon_i2c_monitor(i32 32348, i32 32344)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void trace_print(const char *prefix, const char *fmt, va_list ap) {
  fprintf(stderr, "%s | ", prefix);
  vfprintf(stderr, fmt, ap);
}


x86 assembly (clang, -O0):
<trace_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_print>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s | \00"
define void @trace_print(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @vfprintf(i32 %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s | \00"
define void @trace_print(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @vfprintf(i32 %6, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct VM {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bin_to_uint32(int /*<<< orphan*/ const *);
int load_lvar(struct VM *vm, const uint8_t **pos) {
  const uint8_t *p = *pos;
  *pos += bin_to_uint32(p + 4);
  return 0;
}


x86 assembly (clang, -O0):
<load_lvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x10,%rdi
call   1030 <bin_to_uint32@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_lvar>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
add    $0x10,%rdi
call   1030 <bin_to_uint32@plt>
cltq
shl    $0x2,%rax
add    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.VM = type { i32 }
define i32 @load_lvar(%struct.VM* %0, i32** %1) {
%3 = alloca %struct.VM*
%4 = alloca i32**
%5 = alloca i32*
store %struct.VM* %0, %struct.VM** %3
store i32** %1, i32*** %4
%6 = load i32**, i32*** %4
%7 = load i32*, i32** %6
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 4
%10 = call i32 @bin_to_uint32(i32* %9)
%11 = load i32**, i32*** %4
%12 = load i32*, i32** %11
%13 = sext i32 %10 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %11
ret i32 0
}

LLVM IR (-O2):
%struct.VM = type { i32 }
define i32 @load_lvar(%struct.VM* nocapture readnone %0, i32** nocapture %1) {
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = tail call i32 @bin_to_uint32(i32* %4)
%6 = load i32*, i32** %1
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32* %8, i32** %1
ret i32 0
}
char *engine_get_identity(void) { return "threaded"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"threaded\00"
define i8* @engine_get_identity() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M221_f(char *s) {
  debug("M221_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M221_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M221_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M221_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M221_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M221_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M221_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int uchar_to_int(unsigned char c) { return c; }


x86 assembly (clang, -O0):
<uchar_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @uchar_to_int(i8 zeroext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long ftell(int /*<<< orphan*/ *);
long pc_lengthbin(void *handle) { return ftell((FILE *)handle); }


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

x86 assembly (clang, -O2):
<pc_lengthbin>:
jmp    1030 <ftell@plt>

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

LLVM IR (-O2):
define i64 @pc_lengthbin(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @ftell(i32* %2)
ret i64 %3
}
unsigned int hash(const char *string, unsigned int scale) {
  unsigned int x = 0;
  for (unsigned int i = 0; string[i] != 0; ++i) {
    x <<= 3;
    x ^= string[i];
  }
  return (scale / x) % 41;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1155 <hash+0x55>
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <hash+0x19>
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
mov    $0x29,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %esi,%eax
mov    (%rdi),%sil
xor    %ecx,%ecx
test   %sil,%sil
je     1137 <hash+0x37>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %sil,%esi
shl    $0x3,%ecx
xor    %esi,%ecx
mov    %edx,%esi
movzbl (%rdi,%rsi,1),%esi
add    $0x1,%edx
test   %sil,%sil
jne    1120 <hash+0x20>
xor    %edx,%edx
div    %ecx
mov    $0xc7ce0c7d,%ecx
imul   %rax,%rcx
shr    $0x25,%rcx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,8),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %26, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %29
15: ; preds = %7
%16 = load i32, i32* %5
%17 = shl i32 %16, 3
store i32 %17, i32* %5
%18 = load i8*, i8** %3
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i32, i32* %5
%25 = xor i32 %24, %23
store i32 %25, i32* %5
br label %26
26: ; preds = %15
%27 = load i32, i32* %6
%28 = add i32 %27, 1
store i32 %28, i32* %6
br label %7
29: ; preds = %7
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = udiv i32 %30, %31
%33 = urem i32 %32, 41
ret i32 %33
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %9, %2
%6 = phi i32 [ 0, %2 ], [ %15, %9 ]
%7 = udiv i32 %1, %6
%8 = urem i32 %7, 41
ret i32 %8
9: ; preds = %2, %9
%10 = phi i8 [ %19, %9 ], [ %3, %2 ]
%11 = phi i32 [ %16, %9 ], [ 0, %2 ]
%12 = phi i32 [ %15, %9 ], [ 0, %2 ]
%13 = sext i8 %10 to i32
%14 = shl i32 %12, 3
%15 = xor i32 %14, %13
%16 = add i32 %11, 1
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %5, label %9
}
unsigned scale2x_generic_input_fmts() { return (1 << 1) | (1 << 0); }


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

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

LLVM IR (-O0):
define i32 @scale2x_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @scale2x_generic_input_fmts() {
ret i32 3
}
/* Variables and functions */
int write(int const, char *, size_t);
int serial_write(const int fd, char *buff, size_t size) {
  return write(fd, buff, size);
}


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

x86 assembly (clang, -O2):
<serial_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @serial_write(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 @write(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @serial_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
float __nv_fast_log10f(float);
float __log10f(float __a) { return __nv_fast_log10f(__a); }


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

x86 assembly (clang, -O2):
<__log10f>:
jmp    1030 <__nv_fast_log10f@plt>

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

LLVM IR (-O2):
define float @__log10f(float %0) {
%2 = tail call float @__nv_fast_log10f(float %0)
ret float %2
}
int round_up(double dat) { return (int)(dat + 0.5); }


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @round_up(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @round_up(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _asm(char *);
void OS_RI(char temp) {
  _asm("  push    A       ");
  _asm("  pop     CC      ");
}


x86 assembly (clang, -O0):
<OS_RI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <_asm@plt>
lea    0xee2(%rip),%rdi
call   1030 <_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_RI>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <_asm@plt>
lea    0xeef(%rip),%rdi
pop    %rax
jmp    1030 <_asm@plt>

LLVM IR (-O0):
@.str = [19 x i8] c" push A \00"
@.str.1 = [19 x i8] c" pop CC \00"
define void @OS_RI(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @_asm(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @_asm(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c" push A \00"
@.str.1 = [19 x i8] c" pop CC \00"
define void @OS_RI(i8 signext %0) {
%2 = tail call i32 @_asm(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @_asm(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *allocate(size_t size) {
  void *p;
  p = malloc(size);
  if (!p) {
    fputs("Out of memory.\n", stderr);
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <allocate+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <allocate+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define i8* @allocate(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define noalias i8* @allocate(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
void gfile_null_on_close(void *ud) { ((void)ud); }


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

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

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

LLVM IR (-O2):
define void @gfile_null_on_close(i8* nocapture %0) {
ret void
}
void XtParseTranslationTable() {}


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

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

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

LLVM IR (-O2):
define void @XtParseTranslationTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __delay_us(int);
int /*<<< orphan*/ enPort(int);
void pulse() {
  enPort(0);
  __delay_us(1);
  enPort(1);
  __delay_us(1);
  enPort(0);
  __delay_us(100);
}


x86 assembly (clang, -O0):
<pulse>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <enPort@plt>
mov    $0x1,%edi
call   1030 <__delay_us@plt>
mov    $0x1,%edi
call   1040 <enPort@plt>
mov    $0x1,%edi
call   1030 <__delay_us@plt>
xor    %edi,%edi
call   1040 <enPort@plt>
mov    $0x64,%edi
call   1030 <__delay_us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulse>:
push   %rax
xor    %edi,%edi
call   1040 <enPort@plt>
mov    $0x1,%edi
call   1030 <__delay_us@plt>
mov    $0x1,%edi
call   1040 <enPort@plt>
mov    $0x1,%edi
call   1030 <__delay_us@plt>
xor    %edi,%edi
call   1040 <enPort@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <__delay_us@plt>

LLVM IR (-O0):
define void @pulse() {
%1 = call i32 @enPort(i32 0)
%2 = call i32 @__delay_us(i32 1)
%3 = call i32 @enPort(i32 1)
%4 = call i32 @__delay_us(i32 1)
%5 = call i32 @enPort(i32 0)
%6 = call i32 @__delay_us(i32 100)
ret void
}

LLVM IR (-O2):
define void @pulse() {
%1 = tail call i32 @enPort(i32 0)
%2 = tail call i32 @__delay_us(i32 1)
%3 = tail call i32 @enPort(i32 1)
%4 = tail call i32 @__delay_us(i32 1)
%5 = tail call i32 @enPort(i32 0)
%6 = tail call i32 @__delay_us(i32 100)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int ENOSYS;
int pthread_mutex_setprioceiling(pthread_mutex_t *mutex, int prioceiling,
                                 int *old_ceiling) {
  return (ENOSYS);
}


x86 assembly (clang, -O0):
<pthread_mutex_setprioceiling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_mutex_setprioceiling(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close_safe(int);
int /*<<< orphan*/ dup2_safe(int, int);
void move_fd(int oldfd, int newfd) {
  if (oldfd != newfd) {
    dup2_safe(oldfd, newfd);
    close_safe(oldfd);
  }
}


x86 assembly (clang, -O0):
<move_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     114d <move_fd+0x2d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <dup2_safe@plt>
mov    -0x4(%rbp),%edi
call   1030 <close_safe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_fd>:
cmp    %esi,%edi
jne    1125 <move_fd+0x5>
ret
push   %rbx
mov    %edi,%ebx
call   1040 <dup2_safe@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close_safe@plt>

LLVM IR (-O0):
define void @move_fd(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 ne i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @dup2_safe(i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @close_safe(i32 %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @move_fd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @dup2_safe(i32 %0, i32 %1)
%6 = tail call i32 @close_safe(i32 %0)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bbswitch_write(char *);
void bbswitch_on(void) { bbswitch_write("ON\n"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"ON\0A\00"
define void @bbswitch_on() {
%1 = tail call i32 @bbswitch_write(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
main() {
  int i;
  int *j;
  j = &i;
  printf("j=%u,i=%d,&i=%u,&j=%u", j, i, &i, &j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rcx
lea    -0x10(%rbp),%r8
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rcx
mov    %rcx,0x8(%rsp)
lea    0xedb(%rip),%rdi
lea    0x8(%rsp),%r8
mov    %rcx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"j=%u,i=%d,&i=%u,&j=%u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* %3, i32 %4, i32* %1, i32** %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"j=%u,i=%d,&i=%u,&j=%u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* %1, i32 undef, i32* %1, i32** %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testIdr() { printf("Hello Idris support library!\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Hello Idris support library!\0A\00"
define void @testIdr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Hello Idris support library!\00"
define void @testIdr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct cpio {
  int dummy;
};
struct archive_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lafe_warnc(int /*<<< orphan*/, char *);
int restore_time(struct cpio *cpio, struct archive_entry *entry,
                 const char *name, int fd) {
  static int warned = 0;
  (void)cpio;
  (void)entry;
  (void)name;
  if (!warned)
    lafe_warnc(0, "Can't restore access times on this platform");
  warned = 1;
  return (fd);
  return (fd);
}


x86 assembly (clang, -O0):
<restore_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,0x2efe(%rip)
jne    1142 <restore_time+0x32>
xor    %edi,%edi
lea    0xec3(%rip),%rsi
call   1030 <lafe_warnc@plt>
movl   $0x1,0x2ee0(%rip)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_time>:
push   %rbx
mov    %ecx,%ebx
cmpb   $0x0,0x2f12(%rip)
jne    112a <restore_time+0x1a>
lea    0xedd(%rip),%rsi
xor    %edi,%edi
call   1030 <lafe_warnc@plt>
movb   $0x1,0x2efb(%rip)
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cpio = type { i32 }
%struct.archive_entry = type { i32 }
@restore_time.warned = internal global i32 0
@.str = [44 x i8] c"Can't restore access times on this platform\00"
define i32 @restore_time(%struct.cpio* %0, %struct.archive_entry* %1, i8* %2, i32 %3) {
%5 = alloca %struct.cpio*
%6 = alloca %struct.archive_entry*
%7 = alloca i8*
%8 = alloca i32
store %struct.cpio* %0, %struct.cpio** %5
store %struct.archive_entry* %1, %struct.archive_entry** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.cpio*, %struct.cpio** %5
%10 = load %struct.archive_entry*, %struct.archive_entry** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* @restore_time.warned
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %4
%15 = call i32 @lafe_warnc(i32 0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %4
store i32 1, i32* @restore_time.warned
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
%struct.cpio = type { i32 }
%struct.archive_entry = type { i32 }
@restore_time.warned = internal unnamed_addr global i1 false
@.str = [44 x i8] c"Can't restore access times on this platform\00"
define i32 @restore_time(%struct.cpio* nocapture readnone %0, %struct.archive_entry* nocapture readnone %1, i8* nocapture readnone %2, i32 returned %3) {
%5 = load i1, i1* @restore_time.warned
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @lafe_warnc(i32 0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
store i1 true, i1* @restore_time.warned
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_hadd_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mul_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 _mm_magnitudesquared_ps_sse3(__m128 cplxValue1, __m128 cplxValue2) {
  cplxValue1 = _mm_mul_ps(cplxValue1, cplxValue1);
  cplxValue2 = _mm_mul_ps(cplxValue2, cplxValue2);
  return _mm_hadd_ps(cplxValue1, cplxValue2);
}


x86 assembly (clang, -O0):
<_mm_magnitudesquared_ps_sse3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <_mm_mul_ps@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_mul_ps@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_hadd_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_magnitudesquared_ps_sse3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%esi
call   1030 <_mm_mul_ps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %ebx,%esi
call   1030 <_mm_mul_ps@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_mm_hadd_ps@plt>

LLVM IR (-O0):
define i32 @_mm_magnitudesquared_ps_sse3(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* %3
%7 = call i32 @_mm_mul_ps(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @_mm_mul_ps(i32 %8, i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @_mm_hadd_ps(i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @_mm_magnitudesquared_ps_sse3(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mul_ps(i32 %0, i32 %0)
%4 = tail call i32 @_mm_mul_ps(i32 %1, i32 %1)
%5 = tail call i32 @_mm_hadd_ps(i32 %3, i32 %4)
ret i32 %5
}
long double cosl(long double x) {
  long double sin;
  __asm__ __volatile__("fldt %2;"
                       "fsincos;"
                       "fstpt %1;"
                       "fstpt %0"
                       : "=m"(sin), "=m"(x)
                       : "m"(x));
  return x;
}


x86 assembly (clang, -O0):
<cosl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fsincos
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosl>:
fldt   0x8(%rsp)
fstpt  -0x28(%rsp)
fldt   -0x28(%rsp)
fsincos
fstpt  -0x28(%rsp)
fstpt  -0x18(%rsp)
fldt   -0x28(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @cosl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = bitcast x86_fp80* %3 to i8*
%5 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ test45_M_bar__E();
void test45_Test2_test__I() {
  foo();
  test45_M_bar__E();
}


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

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

LLVM IR (-O0):
define void @test45_Test2_test__I() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @test45_M_bar__E()
ret void
}

LLVM IR (-O2):
define void @test45_Test2_test__I() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @test45_M_bar__E()
ret void
}
void U_WMREOF_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_WMREOF_print(i8* nocapture %0) {
ret void
}
int compare(const void *a, const void *b) {
  if (*(int *)a > *(int *)b)
    return 1;
  if (*(int *)a < *(int *)b)
    return -1;
  return 0;
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void dumpbytes(const char *buf, size_t len) {
  while (len--)
    printf("%02X ", (unsigned char)*buf++);
}


x86 assembly (clang, -O0):
<dumpbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115c <dumpbytes+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
lea    0xeb1(%rip),%rdi
movzbl (%rax),%esi
call   1030 <printf@plt>
jmp    1120 <dumpbytes+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpbytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <dumpbytes+0x36>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dumpbytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02X \00"
define void @dumpbytes(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
void test9(const void *P) { __builtin_prefetch(P); }


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

x86 assembly (clang, -O2):
<test9>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @test9(i8* nocapture %0) {
tail call void @llvm.prefetch.p0i8(i8* %0, i32 0, i32 3, i32 1)
ret void
}
void uex_iounmap(void *p) {}


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

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

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

LLVM IR (-O2):
define void @uex_iounmap(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int truncate(char *, int);
int main(void) {
  int ret;
  ret = truncate("./test.txt", 30);
  if (ret == -1) {
    perror("truncate");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x1e,%esi
call   1030 <truncate@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1165 <main+0x45>
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <main+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1e,%esi
call   1030 <truncate@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     113d <main+0x1d>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"./test.txt\00"
@.str.1 = [9 x i8] c"truncate\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @truncate(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 30)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"./test.txt\00"
@.str.1 = [9 x i8] c"truncate\00"
define i32 @main() {
%1 = tail call i32 @truncate(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 30)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %6
}
int ifdown(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ifdown() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ifdown() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, long *);
char *strchr(char const *, int);
long header_id_number(const char *header_id) {
  const char *ps;
  long number;
  ps = strchr(header_id, (int)':');
  sscanf(++ps, "%ld", &number);
  return (number);
}


x86 assembly (clang, -O0):
<header_id_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
lea    0xeaf(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_id_number>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rdi
lea    0xeca(%rip),%rsi
mov    %rsp,%rdx
call   1040 <sscanf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i64 @header_id_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i32 58)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %4)
%10 = load i64, i64* %4
ret i64 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @header_id_number(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 58)
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%7 = load i64, i64* %2
ret i64 %7
}
void ff_hevc_put_hevc_uni_epel_hv6_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv6_8_sse4() {
ret void
}
/* Variables and functions */
unsigned char tolower(unsigned char);
char *strlwr(char *s) {
  unsigned char *ucs = (unsigned char *)s;
  for (; *ucs != '\0'; ucs++) {
    *ucs = tolower(*ucs);
  }
  return s;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <strlwr+0x49>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call zeroext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}