xunge/DecIR huggingface dataset:
void TwoByteSwap(unsigned char *buf, int nbytes) {
  unsigned char c;
  for (; nbytes > 0; nbytes -= 2, buf += 2) {
    c = buf[0];
    buf[0] = buf[1];
    buf[1] = c;
  }
}


x86 assembly (clang, -O0):
<TwoByteSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114f <TwoByteSwap+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <TwoByteSwap+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TwoByteSwap>:
test   %esi,%esi
jle    1120 <TwoByteSwap+0x20>
add    $0x2,%esi
nopw   0x0(%rax,%rax,1)
rolw   $0x8,(%rdi)
add    $0xfffffffe,%esi
add    $0x2,%rdi
cmp    $0x2,%esi
ja     1110 <TwoByteSwap+0x10>
ret

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

LLVM IR (-O2):
define void @TwoByteSwap(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i8* [ %11, %4 ], [ %0, %2 ]
%6 = phi i32 [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %7, i8* %8
%10 = add nsw i32 %6, -2
%11 = getelementptr inbounds i8, i8* %5, i64 2
%12 = icmp ugt i32 %6, 2
br i1 %12, label %4, label %13
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ die(char *, int);
void sighandler(int signum) {
  if (signum == SIGCHLD)
    die("Child terminated unexpectedly.", 30);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113e <sighandler+0x2e>
lea    0xecc(%rip),%rdi
mov    $0x1e,%esi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    112c <sighandler+0x1c>
lea    0xede(%rip),%rdi
mov    $0x1e,%esi
jmp    1030 <die@plt>
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
@.str = [31 x i8] c"Child terminated unexpectedly.\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGCHLD
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 30)
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@.str = [31 x i8] c"Child terminated unexpectedly.\00"
define void @sighandler(i32 %0) {
%2 = load i32, i32* @SIGCHLD
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 30)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct _stor_fread_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fread_req *);
void stor_fread_req_free(struct _stor_fread_req *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fread_req_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._stor_fread_req = type { i32 }
define void @stor_fread_req_free(%struct._stor_fread_req* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fread_req* %0)
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, int);
int strcasecmp(const char *s1, const char *s2) {
  return strncasecmp(s1, s2, 2147483647);
}


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

x86 assembly (clang, -O2):
<strcasecmp>:
mov    $0x7fffffff,%edx
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 2147483647)
ret i32 %3
}
int _abs_(int a) { return (a >= 0 ? a : -a); }


x86 assembly (clang, -O0):
<_abs_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <_abs_+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <_abs_+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_abs_(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int syscall(int, char *, int);
int chown(char *file, int uid) { return syscall(38, file, uid); }


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x26,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chown>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x26,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @chown(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 @syscall(i32 38, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @chown(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 38, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int umask(int);
int main() { return !(umask(02) == 02); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <umask@plt>
cmp    $0x2,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @umask(i32 2)
%3 = icmp eq i32 %2, 2
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @umask(i32 2)
%2 = icmp ne i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello eyu\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"hello eyu\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct termios {
  int c_cflag;
};
typedef int speed_t;

/* Variables and functions */
int CBAUD;
int CBAUDEX;
speed_t cfgetospeed(const struct termios *termios_p) {
  return ((termios_p->c_cflag & (CBAUD | CBAUDEX)));
}


x86 assembly (clang, -O0):
<cfgetospeed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2ec2(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfgetospeed>:
mov    0x2ec9(%rip),%rcx
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@CBAUD = global i32 0
@CBAUDEX = global i32 0
define i32 @cfgetospeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @CBAUD
%7 = load i32, i32* @CBAUDEX
%8 = or i32 %6, %7
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@CBAUD = global i32 0
@CBAUDEX = global i32 0
define i32 @cfgetospeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @CBAUD
%5 = load i32, i32* @CBAUDEX
%6 = or i32 %5, %4
%7 = and i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int INT_MAX;
void *malloc(unsigned int);
void *av_malloc(unsigned int size) {
  void *ptr = NULL;
  if (size > (INT_MAX - 16))
    return NULL;
  ptr = malloc(size);
  return ptr;
}


x86 assembly (clang, -O0):
<av_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x10,%ecx
cmp    %ecx,%eax
jbe    1147 <av_malloc+0x37>
movq   $0x0,-0x8(%rbp)
jmp    115b <av_malloc+0x4b>
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_malloc>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
add    $0xfffffff0,%eax
cmp    %edi,%eax
jae    1123 <av_malloc+0x13>
xor    %eax,%eax
ret
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define noalias i8* @av_malloc(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = add nsw i32 %2, -16
%4 = icmp ult i32 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i8* @malloc(i32 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int stp_dyninst_session_init_finished();
int stp_session_init_finished(void) {
  return stp_dyninst_session_init_finished();
}


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

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

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

LLVM IR (-O2):
define i32 @stp_session_init_finished() {
%1 = tail call i32 (...) @stp_dyninst_session_init_finished()
ret i32 %1
}
signed long int signedlongint_ignoring_shortint(signed long int x,
                                                short int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlongint_ignoring_shortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_shortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Type definitions */
struct list_data {
  int dummy;
};

/* Variables and functions */
int remote_fetch_list_aux(char *, struct list_data *, int /*<<< orphan*/);
int remote_fetch_list(char *filemask, struct list_data *d) {
  return remote_fetch_list_aux(filemask, d, 0);
}


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

x86 assembly (clang, -O2):
<remote_fetch_list>:
xor    %edx,%edx
jmp    1030 <remote_fetch_list_aux@plt>

LLVM IR (-O0):
%struct.list_data = type { i32 }
define i32 @remote_fetch_list(i8* %0, %struct.list_data* %1) {
%3 = alloca i8*
%4 = alloca %struct.list_data*
store i8* %0, i8** %3
store %struct.list_data* %1, %struct.list_data** %4
%5 = load i8*, i8** %3
%6 = load %struct.list_data*, %struct.list_data** %4
%7 = call i32 @remote_fetch_list_aux(i8* %5, %struct.list_data* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.list_data = type { i32 }
define i32 @remote_fetch_list(i8* %0, %struct.list_data* %1) {
%3 = tail call i32 @remote_fetch_list_aux(i8* %0, %struct.list_data* %1, i32 0)
ret i32 %3
}
float __ocl_step_float_float(float edge, float x) {
  return (x < edge) ? 0.0f : 1.0;
}


x86 assembly (clang, -O0):
<__ocl_step_float_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
xorps  %xmm0,%xmm0
movsd  0xedd(%rip),%xmm3
movsd  %xmm3,-0x18(%rbp)
ucomiss %xmm2,%xmm1
movsd  %xmm0,-0x10(%rbp)
ja     1140 <__ocl_step_float_float+0x40>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_step_float_float>:
cmpltss %xmm0,%xmm1
movss  0xef3(%rip),%xmm0
andnps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_step_float_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fcmp olt float %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, double 0.000000e+00, double 1.000000e+00
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @__ocl_step_float_float(float %0, float %1) {
%3 = fcmp olt float %1, %0
%4 = select i1 %3, float 0.000000e+00, float 1.000000e+00
ret float %4
}
int getOffset(int size) {
  if ((size % 8) == 0) {
    return size;
  } else {
    while ((size % 8) != 0) {
      size++;
    }
    return size;
  }
}


x86 assembly (clang, -O0):
<getOffset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1126 <getOffset+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <getOffset+0x53>
jmp    112b <getOffset+0x2b>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114d <getOffset+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <getOffset+0x2b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOffset>:
mov    %edi,%ecx
and    $0x7,%ecx
mov    %edi,%eax
neg    %eax
and    $0x7,%eax
test   %ecx,%ecx
cmove  %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getOffset(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp eq i32 %2, 0
%4 = sub i32 0, %0
%5 = and i32 %4, 7
%6 = select i1 %3, i32 0, i32 %5
%7 = add i32 %6, %0
ret i32 %7
}
int is_alpha_num_checker(char c) {
  if (((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'Z')) ||
      ((c >= 'a') && (c <= 'z')))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_alpha_num_checker>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <is_alpha_num_checker+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <is_alpha_num_checker+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     113e <is_alpha_num_checker+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1158 <is_alpha_num_checker+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1164 <is_alpha_num_checker+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1164 <is_alpha_num_checker+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <is_alpha_num_checker+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha_num_checker>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_alpha_num_checker(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 122
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_alpha_num_checker(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int mb_find_next_zero_bit(void *, int, int);
int mb_find_zero_run_len(void *addr, int max, int start) {
  return start + 1 - mb_find_next_zero_bit(addr, max, start);
}


x86 assembly (clang, -O0):
<mb_find_zero_run_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <mb_find_next_zero_bit@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_find_zero_run_len>:
push   %rbx
mov    %edx,%ebx
call   1030 <mb_find_next_zero_bit@plt>
sub    %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mb_find_zero_run_len(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @mb_find_next_zero_bit(i8* %9, i32 %10, i32 %11)
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @mb_find_zero_run_len(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i32 @mb_find_next_zero_bit(i8* %0, i32 %1, i32 %2)
%6 = sub i32 %4, %5
ret i32 %6
}
int apr_netclose(void) {
  int retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<apr_netclose>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @apr_netclose() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F();
int /*<<< orphan*/ S();
void T() {
  F();
  S();
}


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

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

LLVM IR (-O0):
define void @T() {
%1 = call i32 (...) @F()
%2 = call i32 (...) @S()
ret void
}

LLVM IR (-O2):
define void @T() {
%1 = tail call i32 (...) @F()
%2 = tail call i32 (...) @S()
ret void
}
void myAsusDiscoveryDebugPrint(char *pc) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ASN1_TYPE_get_int_octetstring() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char *argv[]) {
  long f3 = 2, f6 = 0, sum = 0, f = 2;
  while (f < 4000000) {
    sum += f;
    f = 4 * f3 + f6;
    f6 = f3;
    f3 = f;
  }
  printf("Sum: %ld\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x2,-0x30(%rbp)
cmpq   $0x3d0900,-0x30(%rbp)
jge    1185 <main+0x75>
mov    -0x30(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <main+0x36>
mov    -0x28(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%eax
xor    %esi,%esi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %rax,%rdx
add    %rax,%rsi
lea    (%rcx,%rax,4),%rax
mov    %rdx,%rcx
cmp    $0x3d0900,%rax
jl     1120 <main+0x10>
push   %rax
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Sum: %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 2, %2 ], [ %9, %3 ]
%5 = phi i64 [ 0, %2 ], [ %7, %3 ]
%6 = phi i64 [ 0, %2 ], [ %4, %3 ]
%7 = add nsw i64 %4, %5
%8 = shl nsw i64 %4, 2
%9 = add nsw i64 %8, %6
%10 = icmp slt i64 %9, 4000000
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 0
}
int in_int_array(int number, const int *arr, int arr_len) {
  for (int i = 0; i < arr_len; i++) {
    if (*(arr + i) == number)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<in_int_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <in_int_array+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <in_int_array+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <in_int_array+0x5b>
jmp    1146 <in_int_array+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <in_int_array+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_int_array>:
test   %edx,%edx
jle    113a <in_int_array+0x3a>
mov    $0x1,%eax
cmp    %edi,(%rsi)
je     1139 <in_int_array+0x39>
mov    %edx,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdx
cmp    %rax,%rcx
je     1131 <in_int_array+0x31>
lea    0x1(%rdx),%rax
cmp    %edi,(%rsi,%rdx,4)
jne    1120 <in_int_array+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @in_int_array(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, %0
br i1 %9, label %21, label %10
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %1, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %0
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %3
%22 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ smbus_delay();
int smbus_wait_until_done(void) {
  unsigned long loops;
  unsigned char byte;
  loops = (100 * 1000 * 10);
  do {
    smbus_delay();
    byte = inb(0xf00 + 0x0);
    if (byte & 1)
      break;
  } while (--loops);
  return loops ? 0 : -1;
}


x86 assembly (clang, -O0):
<smbus_wait_until_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xf4240,-0x8(%rbp)
mov    $0x0,%al
call   1040 <smbus_delay@plt>
mov    $0xf00,%edi
call   1030 <inb@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1159 <smbus_wait_until_done+0x39>
jmp    1174 <smbus_wait_until_done+0x54>
jmp    115e <smbus_wait_until_done+0x3e>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1130 <smbus_wait_until_done+0x10>
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_wait_until_done>:
push   %rbx
mov    $0xf4240,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <smbus_delay@plt>
mov    $0xf00,%edi
call   1030 <inb@plt>
test   $0x1,%al
jne    114d <smbus_wait_until_done+0x2d>
add    $0xffffffffffffffff,%rbx
jne    1130 <smbus_wait_until_done+0x10>
xor    %ebx,%ebx
cmp    $0x1,%rbx
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @smbus_wait_until_done() {
%1 = alloca i64
%2 = alloca i8
store i64 1000000, i64* %1
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @smbus_delay()
%5 = call zeroext i8 @inb(i32 3840)
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %16
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = load i64, i64* %1
%14 = add i64 %13, -1
store i64 %14, i64* %1
%15 = icmp ne i64 %14, 0
br i1 %15, label %3, label %16
16: ; preds = %12, %10
%17 = load i64, i64* %1
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 0, i32 -1
ret i32 %20
}

LLVM IR (-O2):
define i32 @smbus_wait_until_done() {
br label %1
1: ; preds = %7, %0
%2 = phi i64 [ 1000000, %0 ], [ %8, %7 ]
%3 = tail call i32 (...) @smbus_delay()
%4 = tail call zeroext i8 @inb(i32 3840)
%5 = and i8 %4, 1
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = add nsw i64 %2, -1
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %1
10: ; preds = %1, %7
%11 = phi i64 [ %2, %1 ], [ 0, %7 ]
%12 = icmp eq i64 %11, 0
%13 = sext i1 %12 to i32
ret i32 %13
}
int test_imm_09int16_reg(short val) {
  return ((val) & (0x09 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_09int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_09int16_reg>:
test   $0x9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09int16_reg(i16 signext %0) {
%2 = and i16 %0, 9
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTAvlrUIntPtrGetRoot(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrUIntPtrGetRoot() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ active_plugin_fillFDSET(int /*<<< orphan*/ *);
int /*<<< orphan*/ debug(int, char *);
int plugin_fillFDSET(fd_set *set) {
  debug(3, "Plugin filling fdset for blocking");
  active_plugin_fillFDSET(set);
  return 0;
}


x86 assembly (clang, -O0):
<plugin_fillFDSET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
lea    0xec8(%rip),%rsi
call   1030 <debug@plt>
mov    -0x8(%rbp),%rdi
call   1040 <active_plugin_fillFDSET@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_fillFDSET>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x3,%edi
call   1030 <debug@plt>
mov    %rbx,%rdi
call   1040 <active_plugin_fillFDSET@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Plugin filling fdset for blocking\00"
define i32 @plugin_fillFDSET(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @debug(i32 3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @active_plugin_fillFDSET(i32* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Plugin filling fdset for blocking\00"
define i32 @plugin_fillFDSET(i32* %0) {
%2 = tail call i32 @debug(i32 3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @active_plugin_fillFDSET(i32* %0)
ret i32 0
}
unsigned int lv_rec_deinit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lv_rec_deinit() {
ret i32 0
}
double tan(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.tan = [4 x i8] c"tan\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.tan, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.tan = [4 x i8] c"tan\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @tan(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.tan, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int s291_parity(int);
void s291_set_sdid(uint16_t *p_s291, uint8_t i_sdid) {
  p_s291[4] = i_sdid | s291_parity(i_sdid);
}


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

x86 assembly (clang, -O2):
<s291_set_sdid>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <s291_parity@plt>
or     %ebx,%eax
mov    %eax,0x10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @s291_set_sdid(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @s291_parity(i32 %6)
%8 = or i32 %5, %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 4
store i32 %8, i32* %10
ret void
}

LLVM IR (-O2):
define void @s291_set_sdid(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @s291_parity(i32 %1)
%4 = or i32 %3, %1
%5 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printDouble(char headerMessage[], double value) {
  printf("%s", headerMessage);
  printf("%lf\n", value);
}


x86 assembly (clang, -O0):
<printDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDouble>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define void @printDouble(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load double, double* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define void @printDouble(i8* %0, double %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int main() {
  int x = 12;
  printf("x value:     %d\n", x);
  printf("x address:   %p\n", (void *)&x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movslq -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"x value: %d\0A\00"
@.str.1 = [17 x i8] c"x address: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = bitcast i32* %2 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"x value: %d\0A\00"
@.str.1 = [17 x i8] c"x address: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 12, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* inttoptr (i64 12 to i8*))
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int GetStdINCHIKeyFromStdINCHI(char const *, char *);
int cdecl_GetStdINCHIKeyFromStdINCHI(const char *szINCHISource,
                                     char *szINCHIKey) {
  return GetStdINCHIKeyFromStdINCHI(szINCHISource, szINCHIKey);
}


x86 assembly (clang, -O0):
<cdecl_GetStdINCHIKeyFromStdINCHI>:
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 <GetStdINCHIKeyFromStdINCHI@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdecl_GetStdINCHIKeyFromStdINCHI>:
jmp    1030 <GetStdINCHIKeyFromStdINCHI@plt>

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

LLVM IR (-O2):
define i32 @cdecl_GetStdINCHIKeyFromStdINCHI(i8* %0, i8* %1) {
%3 = tail call i32 @GetStdINCHIKeyFromStdINCHI(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void printCPUxSysInfo(const char *cmd) {
  int id;
  sscanf(cmd + 7, "%d", &id);
  output("CPU %d System Load\t0\t100\t%%\n", id + 1);
}


x86 assembly (clang, -O0):
<printCPUxSysInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
lea    0xec5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xeb2(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCPUxSysInfo>:
push   %rax
add    $0x7,%rdi
lea    0xed4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
lea    0xebf(%rip),%rdi
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [29 x i8] c"CPU %d System Load\090\09100\09%%\0A\00"
define void @printCPUxSysInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 7
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i32 @output(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [29 x i8] c"CPU %d System Load\090\09100\09%%\0A\00"
define void @printCPUxSysInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 7
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @output(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
void XSetICValues() {}


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

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

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

LLVM IR (-O2):
define void @XSetICValues() {
ret void
}
/* Variables and functions */
const char *partcode_path(const char *part_type, const char *fs_type) {
  return (NULL);
}


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

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

LLVM IR (-O0):
define i8* @partcode_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @partcode_path(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
unsigned short U2(unsigned char *p) {
  unsigned short value;
  unsigned char *q = (unsigned char *)&value + 1;
  int i;
  for (i = 0; i < 2; i++)
    *q-- = *p++;
  return value;
}


x86 assembly (clang, -O0):
<U2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    1155 <U2+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <U2+0x1b>
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<U2>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @U2(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = load i8, i8* %2
%5 = zext i8 %3 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %4 to i16
%8 = or i16 %6, %7
ret i16 %8
}
void foo(void) {
#pragma omp parallel
  {
#pragma omp cancel parallel if (s)
  }
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}