xunge/DecIR huggingface dataset:
double next_element(double element, double x, double number) {
  return (-1.0 * element * number * (number + 1) * x / 2.0);
}


x86 assembly (clang, -O0):
<next_element>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xef5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @next_element(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fmul double -1.000000e+00, %7
%9 = load double, double* %6
%10 = fmul double %8, %9
%11 = load double, double* %6
%12 = fadd double %11, 1.000000e+00
%13 = fmul double %10, %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = fdiv double %15, 2.000000e+00
ret double %16
}

LLVM IR (-O2):
define double @next_element(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = fmul double %4, %2
%6 = fadd double %2, 1.000000e+00
%7 = fmul double %5, %6
%8 = fmul double %7, %1
%9 = fmul double %8, 5.000000e-01
ret double %9
}
unsigned int cast_ulong_uint_fast(unsigned long int x) {
  return (unsigned int)x;
}


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

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

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

LLVM IR (-O2):
define i32 @cast_ulong_uint_fast(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
void free_files(filec, filev) int filec;
char **filev;
{ free_sp(filev); }


x86 assembly (clang, -O0):
<free_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <free_sp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_files>:
mov    %rsi,%rdi
xor    %eax,%eax
jmp    1030 <free_sp@plt>

LLVM IR (-O0):
define void @free_files(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = call i32 (i8**, ...) bitcast (i32 (...)* @free_sp to i32 (i8**, ...)*)(i8** %5)
ret void
}

LLVM IR (-O2):
define void @free_files(i32 %0, i8** %1) {
%3 = tail call i32 (i8**, ...) bitcast (i32 (...)* @free_sp to i32 (i8**, ...)*)(i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_list(int *array, int length) {
  int i;
  for (i = 0; i < length; i++) {
    printf("%d\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<print_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_list+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_list+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_list>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_list+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_list+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_list(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
float *smalloc_ret(int);
float *mkvec_ret_float(int nl, int nh) {
  float *v;
  v = smalloc_ret((nh - nl + 1) * sizeof(float));
  if (v == NULL) {
    return (NULL);
  } else {
    return (v - nl);
  }
}


x86 assembly (clang, -O0):
<mkvec_ret_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <smalloc_ret@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <mkvec_ret_float+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1168 <mkvec_ret_float+0x58>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkvec_ret_float>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
lea    0x4(,%rsi,4),%edi
call   1030 <smalloc_ret@plt>
movslq %ebx,%rcx
shl    $0x2,%rcx
mov    %rax,%rdx
sub    %rcx,%rdx
test   %rax,%rax
cmovne %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define float* @mkvec_ret_float(i32 %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
%6 = alloca float*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call float* @smalloc_ret(i32 %13)
store float* %14, float** %6
%15 = load float*, float** %6
%16 = icmp eq float* %15, null
br i1 %16, label %17, label %18
17: ; preds = %2
store float* null, float** %3
br label %24
18: ; preds = %2
%19 = load float*, float** %6
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = sub i64 0, %21
%23 = getelementptr inbounds float, float* %19, i64 %22
store float* %23, float** %3
br label %24
24: ; preds = %18, %17
%25 = load float*, float** %3
ret float* %25
}

LLVM IR (-O2):
define float* @mkvec_ret_float(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call float* @smalloc_ret(i32 %5)
%7 = icmp eq float* %6, null
%8 = sext i32 %0 to i64
%9 = sub nsw i64 0, %8
%10 = getelementptr inbounds float, float* %6, i64 %9
%11 = select i1 %7, float* null, float* %10
ret float* %11
}
/* Variables and functions */
int foo(int);
main() { int a = foo(5); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
ret i32 0
}
/* Variables and functions */
int cpu_count();
int is_smp(void) { return cpu_count() > 1; }


x86 assembly (clang, -O0):
<is_smp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cpu_count@plt>
cmp    $0x1,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_smp>:
push   %rax
xor    %eax,%eax
call   1030 <cpu_count@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_smp() {
%1 = call i32 (...) @cpu_count()
%2 = icmp sgt i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @is_smp() {
%1 = tail call i32 (...) @cpu_count()
%2 = icmp sgt i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ append_char(char *, char, int);
int /*<<< orphan*/ append_string(char *, char *, char *, int,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void commit_tags_buffer(char *common_buf, char *tags_buf) {
  append_string(common_buf, tags_buf, "{", 3072 * sizeof(char), 0);
  append_char(common_buf, '}', 3072 * sizeof(char));
  memset(tags_buf, 0, 3072 * sizeof(char));
}


x86 assembly (clang, -O0):
<commit_tags_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdx
mov    $0xc00,%ecx
xor    %r8d,%r8d
call   1030 <append_string@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7d,%esi
mov    $0xc00,%edx
call   1050 <append_char@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc00,%edx
call   1040 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commit_tags_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdx
mov    $0xc00,%ecx
xor    %r8d,%r8d
call   1030 <append_string@plt>
mov    %rbx,%rdi
mov    $0x7d,%esi
mov    $0xc00,%edx
call   1050 <append_char@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc00,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memset@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
define void @commit_tags_buffer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @append_string(i8* %5, i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3072, i32 0)
%8 = load i8*, i8** %3
%9 = call i32 @append_char(i8* %8, i8 signext 125, i32 3072)
%10 = load i8*, i8** %4
%11 = call i32 @memset(i8* %10, i32 0, i32 3072)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"{\00"
define void @commit_tags_buffer(i8* %0, i8* %1) {
%3 = tail call i32 @append_string(i8* %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3072, i32 0)
%4 = tail call i32 @append_char(i8* %0, i8 signext 125, i32 3072)
%5 = tail call i32 @memset(i8* %1, i32 0, i32 3072)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_extension_extract_is(uint16_t instruction) {
  return (instruction >> 0x06) & 0x01;
}


x86 assembly (clang, -O0):
<instruction_extension_extract_is>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_extension_extract_is>:
mov    %edi,%eax
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @instruction_extension_extract_is(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
%5 = and i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @instruction_extension_extract_is(i32 %0) {
%2 = lshr i32 %0, 6
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void h8_to_bytes(char *bytes, uint8_t value) { *(uint8_t *)bytes = value; }


x86 assembly (clang, -O0):
<h8_to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h8_to_bytes>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @h8_to_bytes(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 i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @h8_to_bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
const char *libraryFunction() { return "Hello from Library"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Hello from Library\00"
define i8* @libraryFunction() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hello from Library\00"
define i8* @libraryFunction() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int **);
int main() {
  int a[20];
  foo(3, (int(*)[3]) & a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rsi
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    %rsp,%rsi
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to [3 x i32]*
%3 = bitcast [3 x i32]* %2 to i32**
%4 = call i32 @foo(i32 3, i32** %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = bitcast [20 x i32]* %1 to i32**
%4 = call i32 @foo(i32 3, i32** %3)
ret i32 0
}
extern long long mpy_l_X_l_ll(long mpy1, long mpy2) {
  long long eax;
  __asm__("imull %1\n\t" : "=A"(eax) : "rm"(mpy2), "a"(mpy1));
  return eax;
}


x86 assembly (clang, -O0):
<mpy_l_X_l_ll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,-0x20(%rbp)
imull  -0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @mpy_l_X_l_ll(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = call i64 asm "imull $1\0A\09", "=A,rm,{ax},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
/* Type definitions */
struct ofpbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *ofpbuf_push_uninit(struct ofpbuf *, size_t);
void *ofpbuf_push(struct ofpbuf *b, const void *p, size_t size) {
  void *dst = ofpbuf_push_uninit(b, size);
  memcpy(dst, p, size);
  return dst;
}


x86 assembly (clang, -O0):
<ofpbuf_push>:
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    -0x18(%rbp),%rsi
call   1030 <ofpbuf_push_uninit@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofpbuf_push>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <ofpbuf_push_uninit@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.ofpbuf = type { i32 }
define i8* @ofpbuf_push(%struct.ofpbuf* %0, i8* %1, i64 %2) {
%4 = alloca %struct.ofpbuf*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.ofpbuf* %0, %struct.ofpbuf** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.ofpbuf*, %struct.ofpbuf** %4
%9 = load i64, i64* %6
%10 = call i8* @ofpbuf_push_uninit(%struct.ofpbuf* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %7
ret i8* %15
}

LLVM IR (-O2):
%struct.ofpbuf = type { i32 }
define i8* @ofpbuf_push(%struct.ofpbuf* %0, i8* %1, i64 %2) {
%4 = tail call i8* @ofpbuf_push_uninit(%struct.ofpbuf* %0, i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
ret i8* %4
}
void swap_le32(void *src, void *dest) {
  unsigned char *s = src;
  unsigned char *d = dest;
  d[0] = s[3];
  d[1] = s[2];
  d[2] = s[1];
  d[3] = s[0];
}


x86 assembly (clang, -O0):
<swap_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_le32>:
mov    0x3(%rdi),%al
mov    %al,(%rsi)
mov    0x2(%rdi),%al
mov    %al,0x1(%rsi)
mov    0x1(%rdi),%al
mov    %al,0x2(%rsi)
mov    (%rdi),%al
mov    %al,0x3(%rsi)
ret

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

LLVM IR (-O2):
define void @swap_le32(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = load i8, i8* %0
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
void GpibHw_release(struct GpibHw *gpibHw) {}


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

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

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

LLVM IR (-O2):
%struct.GpibHw = type opaque
define void @GpibHw_release(%struct.GpibHw* nocapture %0) {
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
void *list_delete(struct list *, int);
void *list_pop_back(struct list *self) { return list_delete(self, -1); }


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

x86 assembly (clang, -O2):
<list_pop_back>:
mov    $0xffffffff,%esi
jmp    1030 <list_delete@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define i8* @list_pop_back(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = call i8* @list_delete(%struct.list* %3, i32 -1)
ret i8* %4
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i8* @list_pop_back(%struct.list* %0) {
%2 = tail call i8* @list_delete(%struct.list* %0, i32 -1)
ret i8* %2
}
/* Variables and functions */
char and_b(char *, char *);
signed char intr_wrap_507(signed char p1, signed char p2) {
  return and_b(&p1, &p2);
}


x86 assembly (clang, -O0):
<intr_wrap_507>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
call   1030 <and_b@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_507>:
push   %rax
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1030 <and_b@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_507(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @and_b(i8* %3, i8* %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @intr_wrap_507(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @and_b(i8* %3, i8* %4)
ret i8 %5
}
int mask_check(int check, int mask) { return (check & mask) == mask; }


x86 assembly (clang, -O0):
<mask_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_check>:
not    %edi
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @mask_check(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 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mask_check(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ caempty();
char capop();
scalar_t__ getchar();
char getch(void) { return (caempty()) ? (char)getchar() : capop(); }


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <caempty@plt>
cmp    $0x0,%rax
je     115b <getch+0x2b>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <getch+0x38>
mov    $0x0,%al
call   1050 <capop@plt>
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rax
xor    %eax,%eax
call   1030 <caempty@plt>
test   %rax,%rax
je     1146 <getch+0x16>
xor    %eax,%eax
call   1040 <getchar@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1050 <capop@plt>

LLVM IR (-O0):
define signext i8 @getch() {
%1 = call i64 (...) @caempty()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i64 (...) @getchar()
%5 = trunc i64 %4 to i8
%6 = sext i8 %5 to i32
br label %10
7: ; preds = %0
%8 = call signext i8 (...) @capop()
%9 = sext i8 %8 to i32
br label %10
10: ; preds = %7, %3
%11 = phi i32 [ %6, %3 ], [ %9, %7 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @getch() {
%1 = tail call i64 (...) @caempty()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 (...) @getchar()
%5 = trunc i64 %4 to i8
br label %8
6: ; preds = %0
%7 = tail call signext i8 (...) @capop()
br label %8
8: ; preds = %6, %3
%9 = phi i8 [ %5, %3 ], [ %7, %6 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d\n", sizeof(double)); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xf5() {
  Assert_real((isgraph(245) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1230, ("isgraph should be 0 for 0xf5"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xf5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf5,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4ce,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ce,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf5\00"
define void @t_isgraph_0xf5() {
%1 = call i64 @isgraph(i32 245)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1230, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf5\00"
define void @t_isgraph_0xf5() {
%1 = tail call i64 @isgraph(i32 245)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1230, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sys$release(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(20), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x14,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$release>:
mov    $0x14,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$release"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 20, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$release"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 20, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
int main() {
  int a = 150;
  char b = (char)a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x96,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 150, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double Mag(a)
double a[3];
{ return ((double)sqrt((double)(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]))); }


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

x86 assembly (clang, -O2):
<Mag>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <Mag+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @Mag(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @Mag(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SIMC_Default_Free(void *userdata, void *pointer) { free(pointer); }


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

x86 assembly (clang, -O2):
<SIMC_Default_Free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @SIMC_Default_Free(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @SIMC_Default_Free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void IGMPInit(struct in_addr *iface, struct in_addr *mcaddr) {}


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

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

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

LLVM IR (-O2):
%struct.in_addr = type opaque
define void @IGMPInit(%struct.in_addr* nocapture %0, %struct.in_addr* nocapture %1) {
ret void
}
/* Variables and functions */
int f250(int *);
int f251(int *p) { return f250(p); }


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

x86 assembly (clang, -O2):
<f251>:
jmp    1030 <f250@plt>

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

LLVM IR (-O2):
define i32 @f251(i32* %0) {
%2 = tail call i32 @f250(i32* %0)
ret i32 %2
}
unsigned xrop3_245_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~D;
  stk1 = T | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_245_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_245_0_0>:
lea    -0x100(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_245_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = xor i32 %15, -1
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = or i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @xrop3_245_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = or i32 %3, -256
ret i32 %4
}
int main() {
  do {
    567;
  } while (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <main+0x9>
jmp    110e <main+0xe>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buff[10];
  strcpy(buff, argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x8(%rsi),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [10 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %6, i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_wrctl(int, int);
void _Nios2_Set_ctlreg_bstatus(uint32_t value) {
  __builtin_wrctl(2, (int)value);
}


x86 assembly (clang, -O0):
<_Nios2_Set_ctlreg_bstatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    $0x2,%edi
call   1030 <__builtin_wrctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Nios2_Set_ctlreg_bstatus>:
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <__builtin_wrctl@plt>

LLVM IR (-O0):
define void @_Nios2_Set_ctlreg_bstatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @__builtin_wrctl(i32 2, i32 %4)
ret void
}

LLVM IR (-O2):
define void @_Nios2_Set_ctlreg_bstatus(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @__builtin_wrctl(i32 2, i32 %2)
ret void
}
unsigned int syracuse(unsigned int n) {
  unsigned int c = 0;
  while (n != 1) {
    if (n & 1)
      n = 3 * n + 1;
    else
      n = n / 2;
    ++c;
  }
  return c;
}


x86 assembly (clang, -O0):
<syracuse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     114d <syracuse+0x4d>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1136 <syracuse+0x36>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <syracuse+0x3f>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <syracuse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syracuse>:
xor    %eax,%eax
cmp    $0x1,%edi
je     1127 <syracuse+0x27>
xor    %eax,%eax
nopl   0x0(%rax)
mov    %edi,%ecx
shr    %ecx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
jne    1110 <syracuse+0x10>
ret

LLVM IR (-O0):
define i32 @syracuse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %2
%13 = mul i32 3, %12
%14 = add i32 %13, 1
store i32 %14, i32* %2
br label %18
15: ; preds = %7
%16 = load i32, i32* %2
%17 = udiv i32 %16, 2
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %3
%20 = add i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @syracuse(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %12, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = mul i32 %5, 3
%9 = add i32 %8, 1
%10 = lshr i32 %5, 1
%11 = select i1 %7, i32 %10, i32 %9
%12 = add i32 %4, 1
%13 = icmp eq i32 %11, 1
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %15
}
/* Variables and functions */
int multiply(unsigned int, int);
unsigned power(unsigned a, unsigned b) {
  if (b == 0)
    return 1;
  return multiply(a, power(a, --b));
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1144 <power+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1168 <power+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0xc(%rbp)
call   1030 <power@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <multiply@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
je     1139 <power+0x19>
push   %rbx
mov    %edi,%ebx
add    $0xffffffff,%esi
call   1030 <power@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <multiply@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %9, %6 ], [ 1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = add i32 %1, -1
%8 = tail call i32 @power(i32 %0, i32 %7)
%9 = tail call i32 @multiply(i32 %0, i32 %8)
br label %4
}
void free_vector(char **vector) {
  char **tmp_vector;
  char *tmp_string;
  tmp_vector = vector;
  tmp_string = *(tmp_vector++);
  while (tmp_string) {
    free(tmp_string);
    tmp_string = *(tmp_vector++);
  }
  free(vector);
}


x86 assembly (clang, -O0):
<free_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <free_vector+0x59>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    113a <free_vector+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_vector+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_vector+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_vector(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
tail call void @free(i8* %5)
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = bitcast i8** %0 to i8*
tail call void @free(i8* %11)
ret void
}
/* Variables and functions */
double erand48(unsigned short *);
double fb_rand_src_rand48(unsigned short *xi) { return (erand48(xi)); }


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

x86 assembly (clang, -O2):
<fb_rand_src_rand48>:
jmp    1030 <erand48@plt>

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

LLVM IR (-O2):
define double @fb_rand_src_rand48(i16* %0) {
%2 = tail call double @erand48(i16* %0)
ret double %2
}
void UART0Tx(void) {}


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

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

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

LLVM IR (-O2):
define void @UART0Tx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawChar(int /*<<< orphan*/);
int /*<<< orphan*/ setCursor(int, int);
void drawStri(char *s, int x, int y) {
  while (*s) {
    setCursor(x, y);
    drawChar(*(s++));
    x += 8;
  }
}


x86 assembly (clang, -O0):
<drawStri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116f <drawStri+0x4f>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <setCursor@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1040 <drawChar@plt>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <drawStri+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawStri>:
push   %rbp
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     115f <drawStri+0x3f>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <setCursor@plt>
movsbl -0x1(%rbx),%edi
call   1040 <drawChar@plt>
add    $0x8,%ebp
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <drawStri+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @drawStri(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %0, %3 ]
%8 = phi i32 [ %14, %6 ], [ %1, %3 ]
%9 = tail call i32 @setCursor(i32 %8, i32 %2)
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = tail call i32 @drawChar(i32 %12)
%14 = add nsw i32 %8, 8
%15 = load i8, i8* %10
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %3
ret void
}