xunge/DecIR huggingface dataset:
/* Type definitions */
union i2c_smbus_data {
  int byte;
};
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE;
int /*<<< orphan*/ I2C_SMBUS_READ;
scalar_t__ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, union i2c_smbus_data *);
int32_t i2c_smbus_read_byte(int file) {
  union i2c_smbus_data data;
  if (i2c_smbus_access(file, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data))
    return -1;
  return 0xFF & data.byte;
}


x86 assembly (clang, -O0):
<i2c_smbus_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
cmp    $0x0,%rax
je     1151 <i2c_smbus_read_byte+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <i2c_smbus_read_byte+0x4c>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_read_byte>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%r8
xor    %edx,%edx
call   1030 <i2c_smbus_access@plt>
movzbl (%rsp),%ecx
neg    %rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.i2c_smbus_data
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_SMBUS_READ
%7 = load i32, i32* @I2C_SMBUS_BYTE
%8 = call i64 @i2c_smbus_access(i32 %5, i32 %6, i32 0, i32 %7, %union.i2c_smbus_data* %4)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %15
11: ; preds = %1
%12 = bitcast %union.i2c_smbus_data* %4 to i32*
%13 = load i32, i32* %12
%14 = and i32 255, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca %union.i2c_smbus_data
%3 = bitcast %union.i2c_smbus_data* %2 to i8*
%4 = load i32, i32* @I2C_SMBUS_READ
%5 = load i32, i32* @I2C_SMBUS_BYTE
%6 = call i64 @i2c_smbus_access(i32 %0, i32 %4, i32 0, i32 %5, %union.i2c_smbus_data* %2)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = and i32 %9, 255
%11 = select i1 %7, i32 %10, i32 -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printErrorMsg() { printf("Oops! There are unmatched parenthesis."); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Oops! There are unmatched parenthesis.\00"
define void @printErrorMsg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Oops! There are unmatched parenthesis.\00"
define void @printErrorMsg() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int gcd(int, int);
int lcm(int a, int b) { return a * (b / gcd(a, b)); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
imul   %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @gcd(i32 %7, i32 %8)
%10 = sdiv i32 %6, %9
%11 = mul nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = tail call i32 @gcd(i32 %0, i32 %1)
%4 = sdiv i32 %1, %3
%5 = mul nsw i32 %4, %0
ret i32 %5
}
int next_prime_to_raise(const int *powers, int largest_prime) {
  for (int i = 1; i < largest_prime; i++)
    if (powers[i] + 2 <= powers[i - 1])
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<next_prime_to_raise>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <next_prime_to_raise+0x60>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x2,%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     114d <next_prime_to_raise+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <next_prime_to_raise+0x67>
jmp    1152 <next_prime_to_raise+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <next_prime_to_raise+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_prime_to_raise>:
mov    $0xffffffff,%eax
cmp    $0x2,%esi
jl     1137 <next_prime_to_raise+0x37>
mov    %esi,%r8d
mov    (%rdi),%esi
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%r9d
mov    (%rdi,%rdx,4),%esi
lea    0x2(%rsi),%ecx
cmp    %r9d,%ecx
jle    1138 <next_prime_to_raise+0x38>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1120 <next_prime_to_raise+0x20>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @next_prime_to_raise(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
br label %7
7: ; preds = %4, %14
%8 = phi i32 [ %6, %4 ], [ %11, %14 ]
%9 = phi i64 [ 1, %4 ], [ %15, %14 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 2
%13 = icmp sgt i32 %12, %8
br i1 %13, label %14, label %17
14: ; preds = %7
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %19, label %7
17: ; preds = %7
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %14, %17, %2
%20 = phi i32 [ -1, %2 ], [ %18, %17 ], [ -1, %14 ]
ret i32 %20
}
void map_readonly_frames() {}


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

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

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

LLVM IR (-O2):
define void @map_readonly_frames() {
ret void
}
/* Type definitions */
struct statfs {
  unsigned long long f_bsize;
  scalar_t__ f_bfree;
};

/* Variables and functions */
scalar_t__ statfs(char const *, struct statfs *);
unsigned long long get_fs_size(const char *path) {
  unsigned long long ret;
  struct statfs s;
  if (statfs(path, &s) < 0)
    return -1ULL;
  ret = s.f_bsize;
  ret *= (unsigned long long)s.f_bfree;
  return ret;
}


x86 assembly (clang, -O0):
<get_fs_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <statfs@plt>
cmp    $0x0,%rax
jge    1140 <get_fs_size+0x30>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    115d <get_fs_size+0x4d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs_size>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
call   1030 <statfs@plt>
mov    0x10(%rsp),%rcx
imul   0x8(%rsp),%rcx
test   %rax,%rax
mov    $0xffffffffffffffff,%rax
cmovns %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.statfs = type { i64, i64 }
define i64 @get_fs_size(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.statfs
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @statfs(i8* %6, %struct.statfs* %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i64 -1, i64* %2
br label %18
10: ; preds = %1
%11 = getelementptr inbounds %struct.statfs, %struct.statfs* %5, i32 0, i32 0
%12 = load i64, i64* %11
store i64 %12, i64* %4
%13 = getelementptr inbounds %struct.statfs, %struct.statfs* %5, i32 0, i32 1
%14 = load i64, i64* %13
%15 = load i64, i64* %4
%16 = mul i64 %15, %14
store i64 %16, i64* %4
%17 = load i64, i64* %4
store i64 %17, i64* %2
br label %18
18: ; preds = %10, %9
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
%struct.statfs = type { i64, i64 }
define i64 @get_fs_size(i8* %0) {
%2 = alloca %struct.statfs
%3 = bitcast %struct.statfs* %2 to i8*
%4 = call i64 @statfs(i8* %0, %struct.statfs* %2)
%5 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i64 0, i32 1
%8 = load i64, i64* %7
%9 = mul i64 %8, %6
%10 = icmp sgt i64 %4, -1
%11 = select i1 %10, i64 %9, i64 -1
ret i64 %11
}
/* Type definitions */
struct multiple_ir_debug_section_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct multiple_ir_debug_section_item *);
int multiple_ir_debug_section_item_destroy(
    struct multiple_ir_debug_section_item *item) {
  free(item);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.multiple_ir_debug_section_item = type { i32 }
define i32 @multiple_ir_debug_section_item_destroy(%struct.multiple_ir_debug_section_item* %0) {
%2 = alloca %struct.multiple_ir_debug_section_item*
store %struct.multiple_ir_debug_section_item* %0, %struct.multiple_ir_debug_section_item** %2
%3 = load %struct.multiple_ir_debug_section_item*, %struct.multiple_ir_debug_section_item** %2
%4 = call i32 @free(%struct.multiple_ir_debug_section_item* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.multiple_ir_debug_section_item = type { i32 }
define i32 @multiple_ir_debug_section_item_destroy(%struct.multiple_ir_debug_section_item* nocapture %0) {
%2 = tail call i32 @free(%struct.multiple_ir_debug_section_item* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int __gen_tempname(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int mkstemps(char *template, int suffixlen) {
  if (suffixlen < 0) {
    __set_errno(EINVAL);
    return -1;
  }
  return __gen_tempname(template, suffixlen, 0, 0);
}


x86 assembly (clang, -O0):
<mkstemps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1153 <mkstemps+0x33>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <mkstemps+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <__gen_tempname@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemps>:
test   %esi,%esi
js     112d <mkstemps+0xd>
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1040 <__gen_tempname@plt>
push   %rax
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = call i32 @__set_errno(i32 %9)
store i32 -1, i32* %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 @__gen_tempname(i8* %12, i32 %13, i32 0, i32 0)
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @EINVAL
%6 = tail call i32 @__set_errno(i32 %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @__gen_tempname(i8* %0, i32 %1, i32 0, i32 0)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ -1, %4 ], [ %8, %7 ]
ret i32 %10
}
int longCmpFn(const void *p1, const void *p2) {
  long v1, v2;
  v1 = *((long *)p1);
  v2 = *((long *)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<longCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <longCmpFn+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <longCmpFn+0x57>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longCmpFn>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @longCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int _close(int f) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 0
}
void executeCallback(void (*callback)(void)) { callback(); }


x86 assembly (clang, -O0):
<executeCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeCallback>:
jmp    *%rdi

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

LLVM IR (-O2):
define void @executeCallback(void ()* nocapture %0) {
tail call void %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chk_arg(int, char **);
int /*<<< orphan*/ game_main();
int /*<<< orphan*/ init_arg();
int /*<<< orphan*/ init_game();
int main_dos(int argc, char **argv) {
  init_arg();
  chk_arg(argc, argv);
  init_game();
  game_main();
  return 1;
}


x86 assembly (clang, -O0):
<main_dos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init_arg@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <chk_arg@plt>
mov    $0x0,%al
call   1050 <init_game@plt>
mov    $0x0,%al
call   1030 <game_main@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_dos>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <init_arg@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <chk_arg@plt>
xor    %eax,%eax
call   1050 <init_game@plt>
xor    %eax,%eax
call   1030 <game_main@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main_dos(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @init_arg()
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @chk_arg(i32 %6, i8** %7)
%9 = call i32 (...) @init_game()
%10 = call i32 (...) @game_main()
ret i32 1
}

LLVM IR (-O2):
define i32 @main_dos(i32 %0, i8** %1) {
%3 = tail call i32 (...) @init_arg()
%4 = tail call i32 @chk_arg(i32 %0, i8** %1)
%5 = tail call i32 (...) @init_game()
%6 = tail call i32 (...) @game_main()
ret i32 1
}
/* Variables and functions */
bool is_digit(char const c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <is_digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
long fib_s(int);
int task2() {
  long t2 = fib_s(4000000);
  return t2;
}


x86 assembly (clang, -O0):
<task2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3d0900,%edi
call   1030 <fib_s@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task2>:
mov    $0x3d0900,%edi
jmp    1030 <fib_s@plt>

LLVM IR (-O0):
define i32 @task2() {
%1 = alloca i64
%2 = call i64 @fib_s(i32 4000000)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @task2() {
%1 = tail call i64 @fib_s(i32 4000000)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
__attribute__((always_)) uint8_t uvisor_read8(uint8_t volatile *addr) {
  return *(addr);
}


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

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

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

LLVM IR (-O2):
define i32 @uvisor_read8(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
int strcmp(const char *s1, const char *s2) {
  while ((*s1 == *s2) && *s1) {
    s1++;
    s2++;
  }
  return *(const unsigned char *)s1 - *(const unsigned char *)s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <strcmp+0x34>
cmp    %cl,%al
jne    1134 <strcmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <strcmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <strcmp+0x20>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %5
%19 = phi i1 [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = zext i8 %19 to i32
%22 = zext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
/* Variables and functions */
double cdfwak_(double *, double *);
double ccdfwak(double *x, double *para) { return cdfwak_(x, para); }


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

x86 assembly (clang, -O2):
<ccdfwak>:
jmp    1030 <cdfwak_@plt>

LLVM IR (-O0):
define double @ccdfwak(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @cdfwak_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @ccdfwak(double* %0, double* %1) {
%3 = tail call double @cdfwak_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
gen_logical_negation() { gen_call("cclneg"); }


x86 assembly (clang, -O0):
<gen_logical_negation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"cclneg\00"
define i32 @gen_logical_negation() {
%1 = alloca i32
%2 = call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"cclneg\00"
define i32 @gen_logical_negation() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void xorSwap(int *x, int *y) {
  if (x != y) {
    *x ^= *y;
    *y ^= *x;
    *x ^= *y;
  }
}


x86 assembly (clang, -O0):
<xorSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1144 <xorSwap+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorSwap>:
cmp    %rsi,%rdi
je     1111 <xorSwap+0x11>
mov    (%rdi),%eax
xor    (%rsi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @xorSwap(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 %24
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = xor i32 %12, %10
store i32 %13, i32* %11
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = xor i32 %17, %15
store i32 %18, i32* %16
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = load i32*, i32** %3
%22 = load i32, i32* %21
%23 = xor i32 %22, %20
store i32 %23, i32* %21
br label %24
24: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @xorSwap(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = load i32, i32* %0
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %0
%11 = xor i32 %10, %9
store i32 %11, i32* %0
br label %12
12: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
uint16_t rotateR_fun_uint16_t(uint16_t x, int32_t i) {
  if ((i %= 16) == 0)
    return x;
  return (x << (16 - i)) | (x >> i);
}


x86 assembly (clang, -O0):
<rotateR_fun_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
jne    112c <rotateR_fun_uint16_t+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <rotateR_fun_uint16_t+0x48>
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_uint16_t>:
lea    0xf(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xfffffff0,%eax
sub    %eax,%esi
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%edx
shl    %cl,%edx
mov    %edi,%eax
mov    %esi,%ecx
sar    %cl,%eax
or     %edx,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotateR_fun_uint16_t(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 = srem i32 %6, 16
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %20
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 16, %13
%15 = shl i32 %12, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = ashr i32 %16, %17
%19 = or i32 %15, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %11, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @rotateR_fun_uint16_t(i32 %0, i32 %1) {
%3 = srem i32 %1, 16
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 16, %3
%6 = shl i32 %0, %5
%7 = ashr i32 %0, %3
%8 = or i32 %6, %7
%9 = select i1 %4, i32 %0, i32 %8
ret i32 %9
}
/* Variables and functions */
int testLib3ImpDep();
int testLib3Imp(void) { return testLib3ImpDep(); }


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

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

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

LLVM IR (-O2):
define i32 @testLib3Imp() {
%1 = tail call i32 (...) @testLib3ImpDep()
ret i32 %1
}
/* Variables and functions */
scalar_t__ atan2(double, double);
float atan2f(float x, float y) { return (float)atan2((double)x, (double)y); }


x86 assembly (clang, -O0):
<atan2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <atan2@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2f>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
call   1030 <atan2@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atan2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = call i64 @atan2(double %6, double %8)
%10 = sitofp i64 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @atan2f(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = tail call i64 @atan2(double %3, double %4)
%6 = sitofp i64 %5 to float
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t B_PASS64(uint64_t const x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @B_PASS64(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ set_contenido(int, int);
void set_contenido_mem(uint32_t direccion, uint32_t data) {
  set_contenido(direccion, (data & 0xFF));
  set_contenido(direccion + 1, (data >> 8) & 0xFF);
  set_contenido(direccion + 2, (data >> 16) & 0xFF);
  set_contenido(direccion + 3, (data >> 24) & 0xFF);
}


x86 assembly (clang, -O0):
<set_contenido_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
call   1030 <set_contenido@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
call   1030 <set_contenido@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
sar    $0x10,%esi
and    $0xff,%esi
call   1030 <set_contenido@plt>
mov    -0x4(%rbp),%edi
add    $0x3,%edi
mov    -0x8(%rbp),%esi
sar    $0x18,%esi
and    $0xff,%esi
call   1030 <set_contenido@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_contenido_mem>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %edi,%ebx
movzbl %al,%esi
mov    %eax,%ebp
call   1030 <set_contenido@plt>
lea    0x1(%rbx),%edi
mov    %ebp,%eax
movzbl %ah,%esi
call   1030 <set_contenido@plt>
lea    0x2(%rbx),%edi
mov    %ebp,%eax
shr    $0x10,%eax
movzbl %al,%esi
call   1030 <set_contenido@plt>
add    $0x3,%ebx
mov    %ebp,%esi
shr    $0x18,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <set_contenido@plt>

LLVM IR (-O0):
define void @set_contenido_mem(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 %6, 255
%8 = call i32 @set_contenido(i32 %5, i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = call i32 @set_contenido(i32 %10, i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 2
%17 = load i32, i32* %4
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = call i32 @set_contenido(i32 %16, i32 %19)
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 3
%23 = load i32, i32* %4
%24 = ashr i32 %23, 24
%25 = and i32 %24, 255
%26 = call i32 @set_contenido(i32 %22, i32 %25)
ret void
}

LLVM IR (-O2):
define void @set_contenido_mem(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @set_contenido(i32 %0, i32 %3)
%5 = add nsw i32 %0, 1
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = tail call i32 @set_contenido(i32 %5, i32 %7)
%9 = add nsw i32 %0, 2
%10 = lshr i32 %1, 16
%11 = and i32 %10, 255
%12 = tail call i32 @set_contenido(i32 %9, i32 %11)
%13 = add nsw i32 %0, 3
%14 = lshr i32 %1, 24
%15 = tail call i32 @set_contenido(i32 %13, i32 %14)
ret void
}
/* Variables and functions */
int abs(int);
int file_diff(int sq1, int sq2) { return abs((sq1 % 8) - (sq2 % 8)); }


x86 assembly (clang, -O0):
<file_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
sub    %edx,%edi
call   1030 <abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_diff>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
sub    %eax,%edi
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffff8,%ecx
sub    %esi,%ecx
add    %edi,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @file_diff(i32 %0, i32 %1) {
%3 = srem i32 %0, 8
%4 = srem i32 %1, 8
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fillbitskip(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main(void) {
  uint64_t bitskip[(1 << 5)];
  int i;
  fillbitskip(bitskip, 10007);
  for (i = 0; i < (1 << 5); i++) {
    printf("%d: %lu\n", i, bitskip[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x2717,%esi
call   1030 <fillbitskip@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    118e <main+0x6e>
mov    -0x94(%rbp),%esi
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%edx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%rdi
mov    $0x2717,%esi
call   1030 <fillbitskip@plt>
xor    %ebx,%ebx
lea    0xec0(%rip),%r14
mov    (%rsp,%rbx,4),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d: %lu\0A\00"
define i32 @main() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%4 = call i32 @fillbitskip(i32* %3, i32 10007)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %11, %5 ]
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = trunc i64 %6 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %8)
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, 32
br i1 %12, label %13, label %5
13: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lstrip(char *);
int /*<<< orphan*/ rstrip(char *);
void strip(char *s) {
  lstrip(s);
  rstrip(s);
}


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

x86 assembly (clang, -O2):
<strip>:
push   %rbx
mov    %rdi,%rbx
call   1040 <lstrip@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <rstrip@plt>

LLVM IR (-O0):
define void @strip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @lstrip(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @rstrip(i8* %5)
ret void
}

LLVM IR (-O2):
define void @strip(i8* %0) {
%2 = tail call i32 @lstrip(i8* %0)
%3 = tail call i32 @rstrip(i8* %0)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void AVRCP_ResponseSink_AVTransport_GetTransportSettings(
    struct UPnPService *Service, int ErrorCode, void *User, char *PlayMode,
    char *RecQualityMode) {
  printf("AVRCP_ Invoke Response: "
         "AVTransport/GetTransportSettings[ErrorCode:%d](%s,%s)\r\n",
         ErrorCode, PlayMode, RecQualityMode);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_AVTransport_GetTransportSettings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AVRCP_ResponseSink_AVTransport_GetTransportSettings>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [80 x i8] c"AVRCP_ Invoke Response: AVTransport/GetTransportSettings[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_GetTransportSettings(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca %struct.UPnPService*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = load i8*, i8** %9
%13 = load i8*, i8** %10
%14 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [80 x i8] c"AVRCP_ Invoke Response: AVTransport/GetTransportSettings[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_GetTransportSettings(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i8* %4)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ NRF24_InsWrite(int, int *, int);
void NRF24_Write_Reg(uint8_t reg, uint8_t data) {
  NRF24_InsWrite(0x20 | reg, &data, 1);
}


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

x86 assembly (clang, -O2):
<NRF24_Write_Reg>:
push   %rax
mov    %esi,0x4(%rsp)
or     $0x20,%edi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <NRF24_InsWrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @NRF24_Write_Reg(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 = or i32 32, %5
%7 = call i32 @NRF24_InsWrite(i32 %6, i32* %4, i32 1)
ret void
}

LLVM IR (-O2):
define void @NRF24_Write_Reg(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = or i32 %0, 32
%5 = call i32 @NRF24_InsWrite(i32 %4, i32* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long long);
int /*<<< orphan*/ stdout;
void cutils_cout_long_long_print(long long number) {
  fprintf(stdout, "%lldll\n", number);
}


x86 assembly (clang, -O0):
<cutils_cout_long_long_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cout_long_long_print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"%lldll\0A\00"
define void @cutils_cout_long_long_print(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stdout
%4 = load i64, i64* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"%lldll\0A\00"
define void @cutils_cout_long_long_print(i64 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
void mystrcpy(char *to, char *from) {
  int i = 0;
  do {
    to[i] = from[i];
  } while (from[i++] != '\0');
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1113 <mystrcpy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrcpy+0x10>
ret

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

LLVM IR (-O2):
define void @mystrcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = add nuw i64 %4, 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
/* Type definitions */
struct main_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int main_cmdline_parser_required(struct main_args_info *args_info,
                                 const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.main_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main_cmdline_parser_required(%struct.main_args_info* %0, i8* %1) {
%3 = alloca %struct.main_args_info*
%4 = alloca i8*
store %struct.main_args_info* %0, %struct.main_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.main_args_info*, %struct.main_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.main_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main_cmdline_parser_required(%struct.main_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}