xunge/DecIR huggingface dataset:
void delay(unsigned int usec) {
  resetTimer();
  usec /= 1;
  while (timerRead() < usec) {
    __asm volatile("nop");
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <resetTimer@plt>
mov    -0x4(%rbp),%eax
shr    $0x0,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <timerRead@plt>
cmp    -0x4(%rbp),%eax
jae    1151 <delay+0x31>
nop
jmp    113b <delay+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <resetTimer@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <timerRead@plt>
cmp    %ebx,%eax
jae    113e <delay+0x1e>
nop
jmp    1130 <delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @resetTimer()
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1
store i32 %5, i32* %2
br label %6
6: ; preds = %10, %1
%7 = call i32 (...) @timerRead()
%8 = load i32, i32* %2
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = tail call i32 (...) @resetTimer()
%3 = tail call i32 (...) @timerRead()
%4 = icmp ult i32 %3, %0
br i1 %4, label %5, label %8
5: ; preds = %1, %5
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%6 = tail call i32 (...) @timerRead()
%7 = icmp ult i32 %6, %0
br i1 %7, label %5, label %8
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void version(void) {
  fprintf(stdout, "gost3411-2012 %s\n", "0.13");
  fprintf(stdout, "\n");
  fprintf(stdout, "Written by Alexey Degtyarev.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed7(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
lea    0xeda(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [18 x i8] c"gost3411-2012 %s\0A\00"
@.str.1 = [5 x i8] c"0.13\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [30 x i8] c"Written by Alexey Degtyarev.\0A\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [18 x i8] c"gost3411-2012 %s\0A\00"
@.str.1 = [5 x i8] c"0.13\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [30 x i8] c"Written by Alexey Degtyarev.\0A\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
}
reset_ax25(axp) struct ax25_cb *axp;
{
  void lapbstate();
  lapbstate(axp, 0);
  del_ax25(axp);
}


x86 assembly (clang, -O0):
<reset_ax25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <lapbstate@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <del_ax25@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_ax25>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
xor    %eax,%eax
call   1030 <lapbstate@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <del_ax25@plt>

LLVM IR (-O0):
%struct.ax25_cb = type opaque
define i32 @reset_ax25(%struct.ax25_cb* %0) {
%2 = alloca i32
%3 = alloca %struct.ax25_cb*
store %struct.ax25_cb* %0, %struct.ax25_cb** %3
%4 = load %struct.ax25_cb*, %struct.ax25_cb** %3
%5 = load %struct.ax25_cb*, %struct.ax25_cb** %3
%6 = call i32 (%struct.ax25_cb*, ...) bitcast (i32 (...)* @del_ax25 to i32 (%struct.ax25_cb*, ...)*)(%struct.ax25_cb* %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
%struct.ax25_cb = type opaque
define i32 @reset_ax25(%struct.ax25_cb* %0) {
tail call void (%struct.ax25_cb*, i32, ...) bitcast (void (...)* @lapbstate to void (%struct.ax25_cb*, i32, ...)*)(%struct.ax25_cb* %0, i32 0)
%2 = tail call i32 (%struct.ax25_cb*, ...) bitcast (i32 (...)* @del_ax25 to i32 (%struct.ax25_cb*, ...)*)(%struct.ax25_cb* %0)
ret i32 undef
}
/* Type definitions */
struct DIR {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct DIR *opendir(const char *dirname) {
  errno = ENOSYS;
  return NULL;
}


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

x86 assembly (clang, -O2):
<opendir>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.DIR = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.DIR* @opendir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.DIR* null
}

LLVM IR (-O2):
%struct.DIR = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.DIR* @opendir(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret %struct.DIR* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, sq, cb;
  scanf("%d", &a);
  sq = a * a;
  cb = sq * a;
  printf("%d\n%d", sq, cb);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
unsigned curposPrev(const char *const str_top, unsigned curpos) {
  unsigned pos = 0;
  unsigned n;
  while (str_top[pos]) {
    n = (1);
    if (pos + n >= curpos)
      break;
    pos += n;
  }
  return pos;
}


x86 assembly (clang, -O0):
<curposPrev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     114c <curposPrev+0x4c>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     113e <curposPrev+0x3e>
jmp    114c <curposPrev+0x4c>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <curposPrev+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<curposPrev>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
mov    $0x1,%edx
nopl   0x0(%rax)
add    $0x1,%eax
cmpb   $0x0,-0x1(%rdi,%rdx,1)
je     1126 <curposPrev+0x26>
lea    0x1(%rdx),%rsi
cmp    %rcx,%rdx
mov    %rsi,%rdx
jb     1110 <curposPrev+0x10>
ret

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

LLVM IR (-O2):
define i32 @curposPrev(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = add nuw nsw i64 %5, 1
%10 = icmp ult i64 %9, %3
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %5 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strdup(char const *);
char *xStrdup(const char *str) {
  char *data = strdup(str);
  if (!data && str) {
    assert(0);
  }
  return data;
}


x86 assembly (clang, -O0):
<xStrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <xStrdup+0x36>
cmpq   $0x0,-0x8(%rbp)
je     1156 <xStrdup+0x36>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xStrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strdup@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <xStrdup+0x20>
test   %r14,%r14
jne    1140 <xStrdup+0x20>
xor    %edi,%edi
call   1030 <assert@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xStrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @assert(i32 0)
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xStrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @assert(i32 0)
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int strlen(char *);
int al_size(char *astr) {
  if (!astr) {
    return 0;
  }
  return (strlen(astr) + 1);
}


x86 assembly (clang, -O0):
<al_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <al_size+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1142 <al_size+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_size>:
test   %rdi,%rdi
je     1123 <al_size+0x13>
push   %rax
call   1030 <strlen@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @al_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @al_size(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double mytimestamp() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  double ret = 1. * (double)tv.tv_sec + (double)tv.tv_usec / 1000000.;
  return ret;
}


x86 assembly (clang, -O0):
<mytimestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytimestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @mytimestamp() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %6, double %10)
store double %11, double* %2
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @mytimestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
void __SLIC_fun_free_irq_exit(unsigned int __SLIC_arg_1, void *__SLIC_arg_2) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @__SLIC_fun_free_irq_exit(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initClassPath();
int /*<<< orphan*/ initFrame();
int /*<<< orphan*/ initHashMap();
int /*<<< orphan*/ initNativeFrame();
int /*<<< orphan*/ initSystemClass();
int initVM() {
  initClassPath();
  initHashMap();
  initFrame();
  initNativeFrame();
  initSystemClass();
  return 0;
}


x86 assembly (clang, -O0):
<initVM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <initClassPath@plt>
mov    $0x0,%al
call   1030 <initHashMap@plt>
mov    $0x0,%al
call   1040 <initFrame@plt>
mov    $0x0,%al
call   1050 <initNativeFrame@plt>
mov    $0x0,%al
call   1060 <initSystemClass@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initVM>:
push   %rax
xor    %eax,%eax
call   1070 <initClassPath@plt>
xor    %eax,%eax
call   1030 <initHashMap@plt>
xor    %eax,%eax
call   1040 <initFrame@plt>
xor    %eax,%eax
call   1050 <initNativeFrame@plt>
xor    %eax,%eax
call   1060 <initSystemClass@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @initVM() {
%1 = call i32 (...) @initClassPath()
%2 = call i32 (...) @initHashMap()
%3 = call i32 (...) @initFrame()
%4 = call i32 (...) @initNativeFrame()
%5 = call i32 (...) @initSystemClass()
ret i32 0
}

LLVM IR (-O2):
define i32 @initVM() {
%1 = tail call i32 (...) @initClassPath()
%2 = tail call i32 (...) @initHashMap()
%3 = tail call i32 (...) @initFrame()
%4 = tail call i32 (...) @initNativeFrame()
%5 = tail call i32 (...) @initSystemClass()
ret i32 0
}
main() {
  __asm("movl $0, %edi\n"
        "call f\n"
        "ret\n");
  abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%edi
call   1040 <f@plt>
ret
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x0,%edi
call   1040 <f@plt>
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
unreachable
}

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "movl $$0, %edi\0Acall f\0Aret\0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void @abort()
unreachable
}
void is_bigint() {}


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

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

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

LLVM IR (-O2):
define void @is_bigint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello from musl\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [17 x i8] c"Hello from musl\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello from musl\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endblock();
void endoutpieces(void) { endblock(); }


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

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

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

LLVM IR (-O2):
define void @endoutpieces() {
%1 = tail call i32 (...) @endblock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
float nexttowardf(float f, long double td) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<nexttowardf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
fstpt  -0x20(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nexttowardf>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @nexttowardf(float %0, x86_fp80 %1) {
%3 = alloca float
%4 = alloca x86_fp80
store float %0, float* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call i32 @assert(i32 0)
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @nexttowardf(float %0, x86_fp80 %1) {
%3 = tail call i32 @assert(i32 0)
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigsegv_handle(int signal) { exit(2); }


x86 assembly (clang, -O0):
<sigsegv_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigsegv_handle>:
push   %rax
mov    $0x2,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigsegv_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @sigsegv_handle(i32 %0) {
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() { printf("makedir version 1.0\nHitlion King\n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"makedir version 1.0\0AHitlion King\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"makedir version 1.0\0AHitlion King\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *s) {
  fprintf(stderr, "%s\n", s);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int main() {
  30;
  30;
  30;
  20;
  20;
  (10 + 20);
  (10 + 30);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void test_many_space_chars(void) {
  char buf[] = "ab  \t\t";
  trim_right(buf);
  do {
    seatest_assert_string_equal("ab", buf, __FUNCTION__, 34);
  } while (0);
}


x86 assembly (clang, -O0):
<test_many_space_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
mov    $0x0,%al
call   1030 <trim_right@plt>
lea    -0x7(%rbp),%rsi
lea    0xeac(%rip),%rdi
lea    0xea8(%rip),%rdx
mov    $0x22,%ecx
mov    $0x0,%al
call   1040 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_many_space_chars>:
push   %rbx
sub    $0x10,%rsp
movl   $0x90920,0xb(%rsp)
movl   $0x20206261,0x8(%rsp)
20
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <trim_right@plt>
lea    0xebc(%rip),%rdi
lea    0xeb8(%rip),%rdx
mov    %rbx,%rsi
mov    $0x22,%ecx
xor    %eax,%eax
call   1040 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_many_space_chars.buf = [7 x i8] c"ab \09\09\00"
@.str = [3 x i8] c"ab\00"
@__FUNCTION__.test_many_space_chars = [22 x i8] c"test_many_space_chars\00"
define void @test_many_space_chars() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @trim_right to i32 (i8*, ...)*)(i8* %3)
br label %5
5: ; preds = %0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.test_many_space_chars, i64 0, i64 0), i32 34)
br label %8
8: ; preds = %5
ret void
}

LLVM IR (-O2):
@__const.test_many_space_chars.buf = [7 x i8] c"ab \09\09\00"
@.str = [3 x i8] c"ab\00"
@__FUNCTION__.test_many_space_chars = [22 x i8] c"test_many_space_chars\00"
define void @test_many_space_chars() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @trim_right to i32 (i8*, ...)*)(i8* %2)
%4 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.test_many_space_chars, i64 0, i64 0), i32 34)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t mem_index_get(void *mem, void *mem_pool, uint16_t mem_size) {
  return ((uint16_t)((uint8_t *)mem - (uint8_t *)mem_pool) / mem_size);
}


x86 assembly (clang, -O0):
<mem_index_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cltd
idivl  -0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_index_get>:
mov    %edx,%ecx
mov    %rdi,%rax
sub    %rsi,%rax
shr    $0x2,%rax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @mem_index_get(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = ptrtoint i32* %8 to i64
%12 = ptrtoint i32* %10 to i64
%13 = sub i64 %11, %12
%14 = sdiv exact i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = load i32, i32* %6
%17 = sdiv i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @mem_index_get(i8* %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = ptrtoint i8* %1 to i64
%6 = sub i64 %4, %5
%7 = lshr exact i64 %6, 2
%8 = trunc i64 %7 to i32
%9 = sdiv i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void dump_fglrx_version(void) {
  system("fglrxinfo 2> /dev/null | sed -n 's/.*(\\([^)]*\\)).*/\\1/p' > "
         "fglrx_version.txt");
}


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

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

LLVM IR (-O0):
@.str = [77 x i8] c"fglrxinfo 2> /dev/null | sed -n 's/.*(\\([^)]*\\)).*/\\1/p' > fglrx_version.txt\00"
define void @dump_fglrx_version() {
%1 = call i32 @system(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"fglrxinfo 2> /dev/null | sed -n 's/.*(\\([^)]*\\)).*/\\1/p' > fglrx_version.txt\00"
define void @dump_fglrx_version() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read(int, unsigned char *, int);
int /*<<< orphan*/ waitfordata(long);
int silitek_read(int fd, unsigned char *data, long timeout) {
  if (!waitfordata(timeout)) {
    return (0);
  }
  if (!read(fd, data, 1)) {
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<silitek_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <waitfordata@plt>
cmp    $0x0,%eax
jne    1151 <silitek_read+0x31>
movl   $0x0,-0x4(%rbp)
jmp    117e <silitek_read+0x5e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%eax
jne    1177 <silitek_read+0x57>
movl   $0x0,-0x4(%rbp)
jmp    117e <silitek_read+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silitek_read>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <waitfordata@plt>
test   %eax,%eax
je     114e <silitek_read+0x2e>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
jmp    1150 <silitek_read+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @silitek_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @waitfordata(i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @read(i32 %0, i8* %1, i32 1)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
struct memSuite *_srm_malloc_suite(int num) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.memSuite = type opaque
define %struct.memSuite* @_srm_malloc_suite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret %struct.memSuite* null
}

LLVM IR (-O2):
%struct.memSuite = type opaque
define noalias %struct.memSuite* @_srm_malloc_suite(i32 %0) {
ret %struct.memSuite* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void isAlreadyLocked(void) { printf("That is already locked.\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"That is already locked.\0A\00"
define void @isAlreadyLocked() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"That is already locked.\00"
define void @isAlreadyLocked() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t st_ptrsize(const void *p) { return sizeof(void *); }


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

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

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

LLVM IR (-O2):
define i64 @st_ptrsize(i8* nocapture readnone %0) {
ret i64 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned int word1 = 077u, word2 = 0150u, word3 = 0210u;
  printf("%o ", word1 & word2);
  printf("%o ", word1 & word1);
  printf("%o ", word1 & word2 & word3);
  printf("%o\n", word1 & 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3f,-0x8(%rbp)
movl   $0x68,-0xc(%rbp)
movl   $0x88,-0x10(%rbp)
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
and    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
and    -0x10(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
and    $0x1,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%o \00"
@.str.1 = [4 x i8] c"%o\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 63, i32* %2
store i32 104, i32* %3
store i32 136, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = and i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = and i32 %13, %14
%16 = load i32, i32* %4
%17 = and i32 %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %2
%20 = and i32 %19, 1
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%o \00"
@.str.1 = [4 x i8] c"%o\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 40)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 63)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
int ASIC_DMA_GetOpcodeCount(int Address) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @ASIC_DMA_GetOpcodeCount(i32 %0) {
ret i32 2
}
/* Variables and functions */
int _hex_to_int(char *);
double percent_scale(char *data) { return _hex_to_int(data) * 100. / 255.; }


x86 assembly (clang, -O0):
<percent_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_hex_to_int@plt>
cvtsi2sd %eax,%xmm0
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<percent_scale>:
push   %rax
call   1030 <_hex_to_int@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xede(%rip),%xmm0
divsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @percent_scale(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_hex_to_int(i8* %3)
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 1.000000e+02
%7 = fdiv double %6, 2.550000e+02
ret double %7
}

LLVM IR (-O2):
define double @percent_scale(i8* %0) {
%2 = tail call i32 @_hex_to_int(i8* %0)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 1.000000e+02
%5 = fdiv double %4, 2.550000e+02
ret double %5
}
/* Variables and functions */
bool is_value_in_array(int val, int *arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (arr[i] == val) {
      return (true);
    }
  }
  return (false);
}


x86 assembly (clang, -O0):
<is_value_in_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 <is_value_in_array+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <is_value_in_array+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <is_value_in_array+0x5b>
jmp    1146 <is_value_in_array+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <is_value_in_array+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_value_in_array>:
test   %edx,%edx
jle    111e <is_value_in_array+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <is_value_in_array+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <is_value_in_array+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_value_in_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 @is_value_in_array(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: substring < fics.txt > dict.txt\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: substring < fics.txt > dict.txt\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: substring < fics.txt > dict.txt\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ getfloat(float *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float a;
  if (getfloat(&a)) {
    printf("You entered %f\n", a);
  } else {
    printf("You did not enter a valid number\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getfloat@plt>
cmp    $0x0,%rax
je     115e <main+0x3e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    116c <main+0x4c>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <getfloat@plt>
test   %rax,%rax
je     115a <main+0x2a>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1166 <main+0x36>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"You entered %f\0A\00"
@.str.1 = [34 x i8] c"You did not enter a valid number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i64 @getfloat(float* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %7)
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"You entered %f\0A\00"
@str = [33 x i8] c"You did not enter a valid number\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i64 @getfloat(float* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %7)
br label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
ret i32 0
}
long double logl(long double x) {
  long double r;
  if (!x)
    return __pole_error(1);
  __asm__ __volatile__("fyl2x; fldl2e; fdivp" : "=t"(r) : "0"(x), "u"(1.));
  return r;
}


x86 assembly (clang, -O0):
<logl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1154 <logl+0x44>
jp     1154 <logl+0x44>
jmp    113a <logl+0x2a>
xor    %eax,%eax
mov    $0x1,%edi
call   1030 <__pole_error@plt>
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
fstpt  -0x10(%rbp)
jmp    116c <logl+0x5c>
fldt   -0x20(%rbp)
fld1
fxch   %st(1)
fyl2x
fldl2e
fdivp  %st,%st(1)
fstp   %st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logl>:
push   %rax
fldt   0x10(%rsp)
fldz
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jne    1121 <logl+0x11>
jnp    112f <logl+0x1f>
fld1
fxch   %st(1)
fyl2x
fldl2e
fdivp  %st,%st(1)
fstp   %st(1)
pop    %rax
ret
fstp   %st(0)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <__pole_error@plt>
mov    %eax,0x4(%rsp)
fildl  0x4(%rsp)
pop    %rax
ret

LLVM IR (-O0):
define x86_fp80 @logl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = fcmp une x86_fp80 %5, 0xK00000000000000000000
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 (i32, ...) bitcast (i32 (...)* @__pole_error to i32 (i32, ...)*)(i32 1)
%9 = sitofp i32 %8 to x86_fp80
store x86_fp80 %9, x86_fp80* %2
br label %14
10: ; preds = %1
%11 = load x86_fp80, x86_fp80* %3
%12 = call x86_fp80 asm sideeffect "fyl2x; fldl2e; fdivp", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %11, double 1.000000e+00)
store x86_fp80 %12, x86_fp80* %4
%13 = load x86_fp80, x86_fp80* %4
store x86_fp80 %13, x86_fp80* %2
br label %14
14: ; preds = %10, %7
%15 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @logl(x86_fp80 %0) {
%2 = fcmp une x86_fp80 %0, 0xK00000000000000000000
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @__pole_error to i32 (i32, ...)*)(i32 1)
%5 = sitofp i32 %4 to x86_fp80
br label %8
6: ; preds = %1
%7 = tail call x86_fp80 asm sideeffect "fyl2x; fldl2e; fdivp", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0, double 1.000000e+00)
br label %8
8: ; preds = %6, %3
%9 = phi x86_fp80 [ %7, %6 ], [ %5, %3 ]
ret x86_fp80 %9
}
void setprotoent(int stayopen) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<setprotoent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1132 <setprotoent+0x22>

x86 assembly (clang, -O2):
<setprotoent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <setprotoent+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.setprotoent = [12 x i8] c"setprotoent\00"
define void @setprotoent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.setprotoent, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.setprotoent = [12 x i8] c"setprotoent\00"
define void @setprotoent(i32 %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.setprotoent, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
void av_get_sample_fmt_string() {}


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

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

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

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