xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ g5_set_xiMC(int /*<<< orphan*/, int, double **);
void g5_set_xi(int ni, double (*xi)[3]) { g5_set_xiMC(0, ni, xi); }


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

x86 assembly (clang, -O2):
<g5_set_xi>:
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <g5_set_xiMC@plt>

LLVM IR (-O0):
define void @g5_set_xi(i32 %0, [3 x double]* %1) {
%3 = alloca i32
%4 = alloca [3 x double]*
store i32 %0, i32* %3
store [3 x double]* %1, [3 x double]** %4
%5 = load i32, i32* %3
%6 = load [3 x double]*, [3 x double]** %4
%7 = bitcast [3 x double]* %6 to double**
%8 = call i32 @g5_set_xiMC(i32 0, i32 %5, double** %7)
ret void
}

LLVM IR (-O2):
define void @g5_set_xi(i32 %0, [3 x double]* %1) {
%3 = bitcast [3 x double]* %1 to double**
%4 = tail call i32 @g5_set_xiMC(i32 0, i32 %0, double** %3)
ret void
}
/* Type definitions */
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
int CHAR_MAX;
int _Locale_n_sep_by_space(struct _Locale_monetary *lmon
                           __attribute__((__unused__))) {
  return CHAR_MAX;
}


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

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

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
@CHAR_MAX = global i32 0
define i32 @_Locale_n_sep_by_space(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
%3 = load i32, i32* @CHAR_MAX
ret i32 %3
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
@CHAR_MAX = global i32 0
define i32 @_Locale_n_sep_by_space(%struct._Locale_monetary* nocapture readnone %0) {
%2 = load i32, i32* @CHAR_MAX
ret i32 %2
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int hi_set_rcvbuf(int sd, int size) {
  socklen_t len;
  len = sizeof(size);
  return setsockopt(sd, SOL_SOCKET, SO_RCVBUF, &size, len);
}


x86 assembly (clang, -O0):
<hi_set_rcvbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%r8d
lea    -0x8(%rbp),%rcx
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_set_rcvbuf>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @hi_set_rcvbuf(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 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_RCVBUF
%9 = load i32, i32* %5
%10 = call i32 @setsockopt(i32 %6, i32 %7, i32 %8, i32* %4, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @hi_set_rcvbuf(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_RCVBUF
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %3, i32 4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
void CommandDone(Widget widget, Atom *selection, Atom *target) {}


x86 assembly (clang, -O0):
<CommandDone>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @CommandDone(i32 %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_err(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/transfer.c",
            467, "[ ERROR ] at %s:%d ,err info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/transfer.c",
            467, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x1d3,%r8d
lea    0xf67(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_err>:
mov    %rdi,%r9
lea    0xf81(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x1d3,%esi
mov    $0x1d3,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/transfer.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 467, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 467, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/transfer.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 467, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 467, i8* %0)
ret void
}
int fun(int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_load_si256(int /*<<< orphan*/ const *);
__m256i yy_load_256(const void *a) {
  return _mm256_load_si256((const __m256i *)a);
}


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

x86 assembly (clang, -O2):
<yy_load_256>:
jmp    1030 <_mm256_load_si256@plt>

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

LLVM IR (-O2):
define i32 @yy_load_256(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_mm256_load_si256(i32* %2)
ret i32 %3
}
void stat_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @stat_finish() {
ret void
}
/* Variables and functions */
size_t align_as_(size_t a, size_t n) { return (n + a - 1) / a * a; }


x86 assembly (clang, -O0):
<align_as_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
imul   -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_as_>:
lea    (%rdi,%rsi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     111e <align_as_+0x1e>
mov    %rcx,%rax
xor    %edx,%edx
div    %rdi
jmp    1124 <align_as_+0x24>
mov    %ecx,%eax
xor    %edx,%edx
div    %edi
sub    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @align_as_(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %3
%10 = udiv i64 %8, %9
%11 = load i64, i64* %3
%12 = mul i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @align_as_(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = urem i64 %4, %0
%6 = sub i64 %4, %5
ret i64 %6
}
void write_cb(struct BufferedSocket *buffsock, void *arg) {}


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

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

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

LLVM IR (-O2):
%struct.BufferedSocket = type opaque
define void @write_cb(%struct.BufferedSocket* nocapture %0, i8* nocapture %1) {
ret void
}
int isFullStack(int bottom, int top) { return (bottom == 0 && top == (5 - 1)); }


x86 assembly (clang, -O0):
<isFullStack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <isFullStack+0x23>
cmpl   $0x4,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFullStack>:
xor    $0x4,%esi
xor    %eax,%eax
or     %edi,%esi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isFullStack(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 4
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, unsigned long);
void __constant_memcpy_fromfs(void *to, const void *from, unsigned long n) {
  memcpy(to, from, n);
}


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

x86 assembly (clang, -O2):
<__constant_memcpy_fromfs>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @__constant_memcpy_fromfs(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
const char *charptr_to_str(const char *const v) {
  assert(v != NULL);
  return v == NULL ? "<NULL>" : v;
}


x86 assembly (clang, -O0):
<charptr_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x8(%rbp)
jne    1149 <charptr_to_str+0x39>
lea    0xec0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1151 <charptr_to_str+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charptr_to_str>:
push   %rbx
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
lea    0xee0(%rip),%rbx
cmovne %rdi,%rbx
mov    %eax,%edi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"<NULL>\00"
define i8* @charptr_to_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
br label %12
10: ; preds = %1
%11 = load i8*, i8** %2
br label %12
12: ; preds = %10, %9
%13 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %9 ], [ %11, %10 ]
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"<NULL>\00"
define i8* @charptr_to_str(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp eq i8* %0, null
%6 = select i1 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %6
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
clock_t XSUM_clockSpan(clock_t start) { return clock() - start; }


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

x86 assembly (clang, -O2):
<XSUM_clockSpan>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @XSUM_clockSpan(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @clock()
%4 = load i64, i64* %2
%5 = sub nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @XSUM_clockSpan(i64 %0) {
%2 = tail call i64 (...) @clock()
%3 = sub nsw i64 %2, %0
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t next_pow2(uint32_t v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  v += (v == 0);
  return v;
}


x86 assembly (clang, -O0):
<next_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_pow2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @next_pow2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = add nsw i32 %13, %15
ret i32 %16
}
void pwm4_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @pwm4_iomux_config() {
ret void
}
const char *strerror(int theErrno) { return "unknown error"; }


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"unknown error\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"unknown error\00"
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ count_twos(int);
scalar_t__ count_twos_brute(int);
int test_no_twos() {
  return 0 == count_twos_brute(0) && 0 == count_twos(0) &&
         0 == count_twos_brute(1) && 0 == count_twos(1);
}


x86 assembly (clang, -O0):
<test_no_twos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <count_twos_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1191 <test_no_twos+0x71>
xor    %edi,%edi
call   1040 <count_twos@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1191 <test_no_twos+0x71>
mov    $0x1,%edi
call   1030 <count_twos_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1191 <test_no_twos+0x71>
mov    $0x1,%edi
call   1040 <count_twos@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_twos>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <count_twos_brute@plt>
test   %rax,%rax
jne    115e <test_no_twos+0x3e>
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <count_twos@plt>
test   %rax,%rax
jne    115e <test_no_twos+0x3e>
mov    $0x1,%edi
call   1030 <count_twos_brute@plt>
test   %rax,%rax
jne    115e <test_no_twos+0x3e>
mov    $0x1,%edi
call   1040 <count_twos@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_no_twos() {
%1 = call i64 @count_twos_brute(i32 0)
%2 = icmp eq i64 0, %1
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = call i64 @count_twos(i32 0)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i64 @count_twos_brute(i32 1)
%8 = icmp eq i64 0, %7
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i64 @count_twos(i32 1)
%11 = icmp eq i64 0, %10
br label %12
12: ; preds = %9, %6, %3, %0
%13 = phi i1 [ false, %6 ], [ false, %3 ], [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_no_twos() {
%1 = tail call i64 @count_twos_brute(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i64 @count_twos(i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = tail call i64 @count_twos_brute(i32 1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i64 @count_twos(i32 1)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %3, %0
%14 = phi i32 [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %12, %9 ]
ret i32 %14
}
/* Type definitions */
struct audio_format {
  int dummy;
};

/* Variables and functions */
double audio_format_time_to_size(struct audio_format const *);
double audioFormatSizeToTime(const struct audio_format *af) {
  return 1.0 / audio_format_time_to_size(af);
}


x86 assembly (clang, -O0):
<audioFormatSizeToTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <audio_format_time_to_size@plt>
movaps %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioFormatSizeToTime>:
push   %rax
call   1030 <audio_format_time_to_size@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.audio_format = type { i32 }
define double @audioFormatSizeToTime(%struct.audio_format* %0) {
%2 = alloca %struct.audio_format*
store %struct.audio_format* %0, %struct.audio_format** %2
%3 = load %struct.audio_format*, %struct.audio_format** %2
%4 = call double @audio_format_time_to_size(%struct.audio_format* %3)
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
%struct.audio_format = type { i32 }
define double @audioFormatSizeToTime(%struct.audio_format* %0) {
%2 = tail call double @audio_format_time_to_size(%struct.audio_format* %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int get64_H(uint64_t x) {
  if (((x >> 63) & 0x01) != 0x01)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<get64_H>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x1,%eax
je     1129 <get64_H+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1130 <get64_H+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get64_H(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 63
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @get64_H(i32 %0) {
ret i32 1
}
void RTManifestCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTManifestCreate() {
ret void
}
void slow_work_end_exec(int id, struct slow_work *work) {}


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

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

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

LLVM IR (-O2):
%struct.slow_work = type opaque
define void @slow_work_end_exec(i32 %0, %struct.slow_work* nocapture %1) {
ret void
}
int ft_puiss10(int y) {
  int res;
  if (y > 1)
    res = 10 * (ft_puiss10(y - 1));
  if (y == 1)
    return (10);
  return (res);
}


x86 assembly (clang, -O0):
<ft_puiss10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1136 <ft_puiss10+0x26>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_puiss10@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <ft_puiss10+0x3c>
movl   $0xa,-0x4(%rbp)
jmp    1152 <ft_puiss10+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_puiss10>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1125 <ft_puiss10+0x15>
lea    -0x1(%rbx),%edi
call   1030 <ft_puiss10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%ecx
cmp    $0x1,%ebx
mov    $0xa,%eax
cmovne %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_puiss10(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @ft_puiss10(i32 %4)
%6 = mul nsw i32 %5, 10
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ undef, %1 ]
%9 = icmp eq i32 %0, 1
%10 = select i1 %9, i32 10, i32 %8
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ i2send(int);
void i2stop() { i2send(0x200); }


x86 assembly (clang, -O0):
<i2stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x200,%edi
call   1030 <i2send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2stop>:
mov    $0x200,%edi
jmp    1030 <i2send@plt>

LLVM IR (-O0):
define void @i2stop() {
%1 = call i32 @i2send(i32 512)
ret void
}

LLVM IR (-O2):
define void @i2stop() {
%1 = tail call i32 @i2send(i32 512)
ret void
}
void serialSendByte(unsigned char data) {}


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

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

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

LLVM IR (-O2):
define void @serialSendByte(i8 zeroext %0) {
ret void
}
void cf_init(int *table, int n) {
  int i;
  for (i = 0; i < n; i++)
    table[i] = 0;
}


x86 assembly (clang, -O0):
<cf_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <cf_init+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <cf_init+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_init>:
test   %esi,%esi
jle    1126 <cf_init+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @cf_init(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
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
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @cf_init(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
int nextchar(char *string, int pos) {
  while (string[pos] == ' ' || string[pos] == '\t')
    pos++;
  return pos;
}


x86 assembly (clang, -O0):
<nextchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     113a <nextchar+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <nextchar+0x4a>
jmp    1158 <nextchar+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <nextchar+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextchar>:
mov    %esi,%eax
movslq %esi,%rcx
add    %rdi,%rcx
jmp    1117 <nextchar+0x17>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x20,%dl
je     1110 <nextchar+0x10>
cmp    $0x9,%dl
je     1110 <nextchar+0x10>
ret

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

LLVM IR (-O2):
define i32 @nextchar(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %8, %2
%5 = phi i64 [ %9, %8 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %10 [
i8 32, label %8
i8 9, label %8
]
8: ; preds = %4, %4
%9 = add i64 %5, 1
br label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
void SSMR3PutSInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutSInt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setbits(unsigned int, unsigned int, int, int);
int main(void) {
  unsigned int x = 100;
  unsigned int y = 178;
  int p = 4;
  int n = 2;
  setbits(x, y, p, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0xb2,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <setbits@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0xb2,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <setbits@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @setbits(i32 100, i32 178, i32 4, i32 2)
ret i32 0
}
void hello_loop(void) {}


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

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

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

LLVM IR (-O2):
define void @hello_loop() {
ret void
}
int plotter_pid(int selected_route) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @plotter_pid(i32 %0) {
ret i32 0
}
void GENERAL_NAMES_free(void) {}


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

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

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

LLVM IR (-O2):
define void @GENERAL_NAMES_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pass_size_unsigned(unsigned int *);
void test15(unsigned *I) { pass_size_unsigned(I); }


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

x86 assembly (clang, -O2):
<test15>:
jmp    1030 <pass_size_unsigned@plt>

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

LLVM IR (-O2):
define void @test15(i32* %0) {
%2 = tail call i32 @pass_size_unsigned(i32* %0)
ret void
}
void lvmlockd_set_socket(const char *sock) {}


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

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

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

LLVM IR (-O2):
define void @lvmlockd_set_socket(i8* nocapture %0) {
ret void
}
void ft_reverse(int **tab1, int **tab2) {
  int *tmp;
  tmp = *tab1;
  *tab1 = *tab2;
  *tab2 = tmp;
}


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

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

LLVM IR (-O0):
define void @ft_reverse(i32** %0, i32** %1) {
%3 = alloca i32**
%4 = alloca i32**
%5 = alloca i32*
store i32** %0, i32*** %3
store i32** %1, i32*** %4
%6 = load i32**, i32*** %3
%7 = load i32*, i32** %6
store i32* %7, i32** %5
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
%10 = load i32**, i32*** %3
store i32* %9, i32** %10
%11 = load i32*, i32** %5
%12 = load i32**, i32*** %4
store i32* %11, i32** %12
ret void
}

LLVM IR (-O2):
define void @ft_reverse(i32** nocapture %0, i32** nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32*, i32** %1
store i32* %4, i32** %0
store i32* %3, i32** %1
ret void
}
int __ocl_convert_int_char(char src) { return (int)src; }


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

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

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

LLVM IR (-O2):
define i32 @__ocl_convert_int_char(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
/* Variables and functions */
char *malloc(size_t);
char *str_repeat(char a, size_t n) {
  char *s = malloc(n + 1);
  for (int i = 0; i < n; ++i)
    s[i] = a;
  s[n] = 0;
  return s;
}


x86 assembly (clang, -O0):
<str_repeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1164 <str_repeat+0x54>
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <str_repeat+0x2a>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_repeat>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1149 <str_repeat+0x29>
movzbl %bpl,%esi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @str_repeat(i8 signext %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i64 %1, 0
br i1 %5, label %7, label %6
6: ; preds = %2
br label %7
7: ; preds = %6, %2
%8 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %8
ret i8* %4
}
/* Variables and functions */
char MFRC522_Rd(char);
int /*<<< orphan*/ MFRC522_Wr(char, char);
void MFRC522_Set_Bit(char addr, char mask) {
  MFRC522_Wr(addr, MFRC522_Rd(addr) | mask);
}


x86 assembly (clang, -O0):
<MFRC522_Set_Bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <MFRC522_Rd@plt>
mov    -0x3(%rbp),%cl
movsbl %al,%eax
movsbl -0x2(%rbp),%edx
or     %edx,%eax
movsbl %cl,%edi
movsbl %al,%esi
call   1030 <MFRC522_Wr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_Set_Bit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <MFRC522_Rd@plt>
or     %bl,%al
movsbl %al,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <MFRC522_Wr@plt>

LLVM IR (-O0):
define void @MFRC522_Set_Bit(i8 signext %0, i8 signext %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* %3
%7 = call signext i8 @MFRC522_Rd(i8 signext %6)
%8 = sext i8 %7 to i32
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = or i32 %8, %10
%12 = trunc i32 %11 to i8
%13 = call i32 @MFRC522_Wr(i8 signext %5, i8 signext %12)
ret void
}

LLVM IR (-O2):
define void @MFRC522_Set_Bit(i8 signext %0, i8 signext %1) {
%3 = tail call signext i8 @MFRC522_Rd(i8 signext %0)
%4 = or i8 %3, %1
%5 = tail call i32 @MFRC522_Wr(i8 signext %0, i8 signext %4)
ret void
}
/* Variables and functions */
unsigned int discreet_log2(unsigned int);
unsigned int log2xorseq(unsigned int pos) {
  return discreet_log2(((pos) ^ (pos + 1)) + 1) - 1;
}


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

x86 assembly (clang, -O2):
<log2xorseq>:
push   %rax
lea    0x1(%rdi),%eax
xor    %eax,%edi
add    $0x1,%edi
call   1030 <discreet_log2@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @log2xorseq(i32 %0) {
%2 = add i32 %0, 1
%3 = xor i32 %2, %0
%4 = add i32 %3, 1
%5 = tail call i32 @discreet_log2(i32 %4)
%6 = add i32 %5, -1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int print_uint8(int /*<<< orphan*/, char *);
int print_int8(int8_t n, char *p) {
  int sign;
  if ((sign = n < 0)) {
    *p++ = '-';
    n = -n;
  }
  return print_uint8(n, p) + sign;
}


x86 assembly (clang, -O0):
<print_int8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    113e <print_int8+0x2e>
jmp    1158 <print_int8+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <print_uint8@plt>
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int8>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
js     111b <print_int8+0xb>
mov    %ebx,%edi
jmp    1126 <print_int8+0x16>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
mov    %ebx,%edi
neg    %edi
shr    $0x1f,%ebx
call   1030 <print_uint8@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @print_int8(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %5, %4 ], [ %1, %2 ]
%9 = phi i32 [ %6, %4 ], [ %0, %2 ]
%10 = lshr i32 %0, 31
%11 = tail call i32 @print_uint8(i32 %9, i8* %8)
%12 = add nsw i32 %11, %10
ret i32 %12
}
void ancestset(a, b, c) char *a, *b, *c;
{
  *c = (*a) & (*b);
  if (*c == 0)
    *c = (*a) | (*b);
}


x86 assembly (clang, -O0):
<ancestset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1150 <ancestset+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ancestset>:
mov    (%rsi),%al
and    (%rdi),%al
mov    %al,(%rdx)
je     1109 <ancestset+0x9>
ret
mov    (%rsi),%al
or     (%rdi),%al
mov    %al,(%rdx)
ret

LLVM IR (-O0):
define void @ancestset(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %9, %12
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %6
store i8 %14, i8* %15
%16 = load i8*, i8** %6
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %3
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i8*, i8** %5
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = or i32 %23, %26
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %6
store i8 %28, i8* %29
br label %30
30: ; preds = %20, %3
ret void
}

LLVM IR (-O2):
define void @ancestset(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = load i8, i8* %0
%5 = load i8, i8* %1
%6 = and i8 %5, %4
store i8 %6, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = load i8, i8* %0
%10 = load i8, i8* %1
%11 = or i8 %10, %9
store i8 %11, i8* %2
br label %12
12: ; preds = %8, %3
ret void
}
void led_on(void) { (*((volatile unsigned long *)0xE0028004)) = (1 << 17); }


x86 assembly (clang, -O0):
<led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028004,%eax
movq   $0x20000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_on>:
mov    $0xe0028004,%eax
movq   $0x20000,(%rax)
ret

LLVM IR (-O0):
define void @led_on() {
store volatile i64 131072, i64* inttoptr (i64 3758260228 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_on() {
store volatile i64 131072, i64* inttoptr (i64 3758260228 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simple_expression();
void expression(void) { simple_expression(); }


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

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

LLVM IR (-O0):
define void @expression() {
%1 = call i32 (...) @simple_expression()
ret void
}

LLVM IR (-O2):
define void @expression() {
%1 = tail call i32 (...) @simple_expression()
ret void
}
/* Variables and functions */
int core11_swap(char *, int);
int U_EMRINVERTRGN_swap(char *record, int torev) {
  return (core11_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRINVERTRGN_swap>:
jmp    1030 <core11_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRINVERTRGN_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @core11_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRINVERTRGN_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core11_swap(i8* %0, i32 %1)
ret i32 %3
}