xunge/DecIR huggingface dataset:
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
void hooks_write(struct bufferevent *ev, void *arg) {
  arg = NULL;
  ev = NULL;
}


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

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

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
define void @hooks_write(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
store i8* null, i8** %4
store %struct.bufferevent* null, %struct.bufferevent** %3
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
define void @hooks_write(%struct.bufferevent* nocapture %0, i8* nocapture %1) {
ret void
}
void chdir() {}


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

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

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

LLVM IR (-O2):
define void @chdir() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int __byte(int *, int /*<<< orphan*/);
bool UARTBusy(uint32_t ui32Base) {
  ;
  return ((__byte((int *)(ui32Base + 0x4), 0) & 0x40) ? false : true);
}


x86 assembly (clang, -O0):
<UARTBusy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
mov    %eax,%edx
and    $0x40,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTBusy>:
push   %rax
add    $0x4,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
xor    %ecx,%ecx
test   $0x40,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UARTBusy(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i32*
%6 = call i32 @__byte(i32* %5, i32 0)
%7 = and i32 %6, 64
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @UARTBusy(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @__byte(i32* %3, i32 0)
%5 = lshr i32 %4, 6
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int check_error(int fb, char str[]) {
  if (fb < 0)
    perror(str);
  return -1;
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1132 <check_error+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error>:
test   %edi,%edi
js     111a <check_error+0xa>
mov    $0xffffffff,%eax
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
add    $0x8,%rsp
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @check_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
br label %10
10: ; preds = %7, %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @check_error(i32 %0, i8* nocapture %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
br label %6
6: ; preds = %4, %2
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
void sleep(int number_of_seconds) { delay(1000 * number_of_seconds); }


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <delay@plt>

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

LLVM IR (-O2):
define void @sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @delay(i32 %2)
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int rand_int(int n) {
  if (n <= 0)
    return 0;
  int limit = RAND_MAX - RAND_MAX % n;
  int rnd;
  do {
    rnd = rand();
  } while (rnd >= limit);
  return rnd % n;
}


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <rand_int+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1172 <rand_int+0x62>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x14(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1152 <rand_int+0x42>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
test   %edi,%edi
jle    1147 <rand_int+0x37>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%eax
cltd
idiv   %edi
sub    %edx,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebp,%eax
jge    1130 <rand_int+0x20>
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %25
9: ; preds = %1
%10 = load i32, i32* @RAND_MAX
%11 = load i32, i32* @RAND_MAX
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
%14 = sub nsw i32 %10, %13
store i32 %14, i32* %4
br label %15
15: ; preds = %17, %9
%16 = call i32 (...) @rand()
store i32 %16, i32* %5
br label %17
17: ; preds = %15
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = icmp sge i32 %18, %19
br i1 %20, label %15, label %21
21: ; preds = %17
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = srem i32 %22, %23
store i32 %24, i32* %2
br label %25
25: ; preds = %21, %8
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_int(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i32, i32* @RAND_MAX
%5 = srem i32 %4, %0
%6 = sub nsw i32 %4, %5
br label %7
7: ; preds = %7, %3
%8 = tail call i32 (...) @rand()
%9 = icmp slt i32 %8, %6
br i1 %9, label %10, label %7
10: ; preds = %7
%11 = srem i32 %8, %0
br label %12
12: ; preds = %1, %10
%13 = phi i32 [ %11, %10 ], [ 0, %1 ]
ret i32 %13
}
int main() {
  int *localArr = (int *)0x00000000;
  int *remoteArr1 = (int *)0x02000000;
  *(localArr) = 1;
  *(remoteArr1) = *(localArr);
  *(localArr) += 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x2000000,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
store i32* inttoptr (i64 33554432 to i32*), i32** %3
%4 = load i32*, i32** %2
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int errno;
int WSAGetLastError() { return errno; }


x86 assembly (clang, -O0):
<WSAGetLastError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@errno = global i32 0
define i32 @WSAGetLastError() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @WSAGetLastError() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Type definitions */
struct tq_task {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tq_task *);
int tq_destroy_task(struct tq_task *task) {
  free(task);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tq_task = type { i32 }
define i32 @tq_destroy_task(%struct.tq_task* nocapture %0) {
%2 = tail call i32 @free(%struct.tq_task* %0)
ret i32 0
}
/* Variables and functions */
double taylor(double);
double cos(double angle) { return taylor(angle); }


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

x86 assembly (clang, -O2):
<cos>:
jmp    1030 <taylor@plt>

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

LLVM IR (-O2):
define double @cos(double %0) {
%2 = tail call double @taylor(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fs_univ_rollback(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
uint8_t fs_mr_rollback(uint32_t inode, uint32_t indx, uint64_t prevchunkid,
                       uint64_t chunkid) {
  return fs_univ_rollback(1, inode, indx, prevchunkid, chunkid);
}


x86 assembly (clang, -O0):
<fs_mr_rollback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    $0x1,%edi
call   1030 <fs_univ_rollback@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_rollback>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <fs_univ_rollback@plt>

LLVM IR (-O0):
define i32 @fs_mr_rollback(i32 %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @fs_univ_rollback(i32 1, i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @fs_mr_rollback(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @fs_univ_rollback(i32 1, i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long parent;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
void set_XReparentEvent_parent(void *_p, unsigned long _v) {
  ((XReparentEvent *)_p)->parent = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XReparentEvent_parent(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XReparentEvent_parent(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int shutdown(int, int);
int apr_shutdown(int sock, int mode) { return shutdown(sock, mode); }


x86 assembly (clang, -O0):
<apr_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apr_shutdown>:
jmp    1030 <shutdown@plt>

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

LLVM IR (-O2):
define i32 @apr_shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double wy2u01(uint64_t r) {
  const double _wynorm = 1.0 / (1ull << 52);
  return (r >> 11) * _wynorm;
}


x86 assembly (clang, -O0):
<wy2u01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wy2u01>:
sar    $0xb,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @wy2u01(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0x3CB0000000000000, double* %3
%4 = load i32, i32* %2
%5 = ashr i32 %4, 11
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3CB0000000000000
ret double %7
}

LLVM IR (-O2):
define double @wy2u01(i32 %0) {
%2 = ashr i32 %0, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CB0000000000000
ret double %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vtab;
struct TYPE_3__ {
  int estimatedCost;
};
typedef TYPE_1__ sqlite3_index_info;

/* Variables and functions */
int SQLITE_OK;
int csvtabBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo) {
  pIdxInfo->estimatedCost = 1000000;
  return SQLITE_OK;
}


x86 assembly (clang, -O0):
<csvtabBestIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xf4240,(%rax)
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csvtabBestIndex>:
movl   $0xf4240,(%rsi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@SQLITE_OK = global i32 0
define i32 @csvtabBestIndex(i32* %0, %struct.TYPE_3__* %1) {
%3 = alloca i32*
%4 = alloca %struct.TYPE_3__*
store i32* %0, i32** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
store i32 1000000, i32* %6
%7 = load i32, i32* @SQLITE_OK
ret i32 %7
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@SQLITE_OK = global i32 0
define i32 @csvtabBestIndex(i32* nocapture readnone %0, %struct.TYPE_3__* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
store i32 1000000, i32* %3
%4 = load i32, i32* @SQLITE_OK
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIZE_MAX;
int strncasecmp(char const *, char const *, int /*<<< orphan*/);
int strcasecmp(const char *a, const char *b) {
  return strncasecmp(a, b, SIZE_MAX);
}


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    0x2ea9(%rip),%rax
mov    (%rax),%edx
call   1030 <strncasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@SIZE_MAX = global i32 0
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 = load i32, i32* @SIZE_MAX
%8 = call i32 @strncasecmp(i8* %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i32 @strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i32, i32* @SIZE_MAX
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ truncate_int(unsigned long long const);
uint32_t mul(const unsigned long long x, const unsigned long long y) {
  uint32_t value = truncate_int(x * y);
  return value;
}


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <truncate_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
imul   %rsi,%rdi
jmp    1030 <truncate_int@plt>

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

LLVM IR (-O2):
define i32 @mul(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i32 @truncate_int(i64 %3)
ret i32 %4
}
/* Type definitions */
struct Xploit {
  int dummy;
};

/* Variables and functions */
int setInternalPayloadOpt(struct Xploit *, char *, void *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(void *);
int xploitSetPayloadOpt(struct Xploit *xp, char *paramName, void *newValue) {
  return setInternalPayloadOpt(xp, paramName, newValue, strlen(newValue));
}


x86 assembly (clang, -O0):
<xploitSetPayloadOpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <setInternalPayloadOpt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xploitSetPayloadOpt>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <setInternalPayloadOpt@plt>

LLVM IR (-O0):
%struct.Xploit = type { i32 }
define i32 @xploitSetPayloadOpt(%struct.Xploit* %0, i8* %1, i8* %2) {
%4 = alloca %struct.Xploit*
%5 = alloca i8*
%6 = alloca i8*
store %struct.Xploit* %0, %struct.Xploit** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.Xploit*, %struct.Xploit** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @setInternalPayloadOpt(%struct.Xploit* %7, i8* %8, i8* %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.Xploit = type { i32 }
define i32 @xploitSetPayloadOpt(%struct.Xploit* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @setInternalPayloadOpt(%struct.Xploit* %0, i8* %1, i8* %2, i32 %4)
ret i32 %5
}
unsigned short convert16(unsigned short value, unsigned int format) {
  return (format & (1 << 2)) ? (((value) >> 8) | ((value) << 8)) : value;
}


x86 assembly (clang, -O0):
<convert16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1135 <convert16+0x35>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <convert16+0x3c>
movzwl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert16>:
mov    %edi,%eax
rol    $0x8,%ax
test   $0x4,%sil
cmove  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @convert16(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
br label %19
16: ; preds = %2
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
br label %19
19: ; preds = %16, %8
%20 = phi i32 [ %15, %8 ], [ %18, %16 ]
%21 = trunc i32 %20 to i16
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @convert16(i16 zeroext %0, i32 %1) {
%3 = and i32 %1, 4
%4 = icmp eq i32 %3, 0
%5 = tail call i16 @llvm.bswap.i16(i16 %0)
%6 = select i1 %4, i16 %0, i16 %5
ret i16 %6
}
/* Variables and functions */
double FLT_MAX;
float gdal_DoubleToFloatClamp(double val) {
  if (val >= FLT_MAX)
    return FLT_MAX;
  if (val <= -FLT_MAX)
    return -FLT_MAX;
  return (float)val;
}


x86 assembly (clang, -O0):
<gdal_DoubleToFloatClamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
ucomisd (%rax),%xmm0
jb     1138 <gdal_DoubleToFloatClamp+0x38>
mov    0x2ec2(%rip),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a7 <gdal_DoubleToFloatClamp+0xa7>
movsd  -0x10(%rbp),%xmm1
mov    0x2ea4(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jb     1199 <gdal_DoubleToFloatClamp+0x99>
mov    0x2e78(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a7 <gdal_DoubleToFloatClamp+0xa7>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdal_DoubleToFloatClamp>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
movapd 0xeed(%rip),%xmm2
xorpd  %xmm1,%xmm2
movapd %xmm0,%xmm3
cmplesd %xmm2,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm0,%xmm3
orpd   %xmm2,%xmm3
movapd %xmm1,%xmm2
cmpnlesd %xmm0,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
@FLT_MAX = global double 0.000000e+00
define float @gdal_DoubleToFloatClamp(double %0) {
%2 = alloca float
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* @FLT_MAX
%6 = fcmp oge double %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* @FLT_MAX
%9 = fptrunc double %8 to float
store float %9, float* %2
br label %22
10: ; preds = %1
%11 = load double, double* %3
%12 = load double, double* @FLT_MAX
%13 = fneg double %12
%14 = fcmp ole double %11, %13
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load double, double* @FLT_MAX
%17 = fneg double %16
%18 = fptrunc double %17 to float
store float %18, float* %2
br label %22
19: ; preds = %10
%20 = load double, double* %3
%21 = fptrunc double %20 to float
store float %21, float* %2
br label %22
22: ; preds = %19, %15, %7
%23 = load float, float* %2
ret float %23
}

LLVM IR (-O2):
@FLT_MAX = global double 0.000000e+00
define float @gdal_DoubleToFloatClamp(double %0) {
%2 = load double, double* @FLT_MAX
%3 = fcmp ugt double %2, %0
%4 = fneg double %2
%5 = fcmp oge double %4, %0
%6 = select i1 %5, double %4, double %0
%7 = select i1 %3, double %6, double %2
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_octave_syntax_comment() {
  test_parser_verify_parse(test_parser_sourcefile("octave", " # comment"),
                           "octave", "", "# comment", 0);
}


x86 assembly (clang, -O0):
<test_octave_syntax_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_octave_syntax_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"octave\00"
@.str.1 = [11 x i8] c" # comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"# comment\00"
define void @test_octave_syntax_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"octave\00"
@.str.1 = [11 x i8] c" # comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"# comment\00"
define void @test_octave_syntax_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int fib(int n) {
  if (n < 2)
    return 1;
  else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
adrx0indreg1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((((signed char *)10000000)[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movsbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <adrx0indreg1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <adrx0indreg1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0indreg1>:
movslq %edx,%rax
mov    0x989680(%rax),%cl
xor    %eax,%eax
cmp    (%r9),%cl
setle  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* %5
%11 = icmp sle i8 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void pop_reg64(unsigned int reg64) { put8(0x58 + reg64); }


x86 assembly (clang, -O0):
<pop_reg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x58,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_reg64>:
add    $0x58,%edi
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @pop_reg64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 88, %3
%5 = call i32 @put8(i32 %4)
ret void
}

LLVM IR (-O2):
define void @pop_reg64(i32 %0) {
%2 = add i32 %0, 88
%3 = tail call i32 @put8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This test is testing mips64r2 instructions.\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 = [45 x i8] c"This test is testing mips64r2 instructions.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"This test is testing mips64r2 instructions.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
fd_set *Selective_KillSet(fd_set *s) {
  free(s);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i32* @Selective_KillSet(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void cdq() { db(0x99); }


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

x86 assembly (clang, -O2):
<cdq>:
mov    $0x99,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @cdq() {
%1 = call i32 @db(i32 153)
ret void
}

LLVM IR (-O2):
define void @cdq() {
%1 = tail call i32 @db(i32 153)
ret void
}
int lseek(int file, int ptr, int dir) { return -1; }


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
int bar(int n) { return n == 0 ? 1 : n * (-bar(n - 1)); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <bar+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <bar+0x42>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <bar@plt>
mov    %eax,%edx
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
sub    %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
je     1126 <bar+0x16>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <bar@plt>
imul   %ebx,%eax
neg    %eax
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @bar(i32 %6)
%8 = mul i32 %7, %0
%9 = sub i32 0, %8
br label %3
}
float parseToCelsius(float fahr) { return (fahr - 32.0) * 5.0 / 9.0; }


x86 assembly (clang, -O0):
<parseToCelsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseToCelsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @parseToCelsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double %5, 5.000000e+00
%7 = fdiv double %6, 9.000000e+00
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @parseToCelsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 5.000000e+00
%5 = fdiv double %4, 9.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int _pack2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ magnitude_fun_complexOf_ushort(unsigned int);
unsigned abs_fun_complexOf_ushort(unsigned a) {
  return _pack2(magnitude_fun_complexOf_ushort(a), 0);
}


x86 assembly (clang, -O0):
<abs_fun_complexOf_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <magnitude_fun_complexOf_ushort@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <_pack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_fun_complexOf_ushort>:
push   %rax
call   1040 <magnitude_fun_complexOf_ushort@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <_pack2@plt>

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

LLVM IR (-O2):
define i32 @abs_fun_complexOf_ushort(i32 %0) {
%2 = tail call i32 @magnitude_fun_complexOf_ushort(i32 %0)
%3 = tail call i32 @_pack2(i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_hex_dump(char const *, int, int, int, void const *,
                                  size_t, int);
void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
                          const void *buf, size_t len) {
  print_hex_dump(prefix_str, prefix_type, 16, 1, buf, len, 1);
}


x86 assembly (clang, -O0):
<print_hex_dump_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    $0x10,%edx
mov    $0x1,%ecx
movl   $0x1,(%rsp)
call   1030 <print_hex_dump@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex_dump_bytes>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%r8
movl   $0x1,(%rsp)
mov    $0x10,%edx
mov    $0x1,%ecx
call   1030 <print_hex_dump@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @print_hex_dump_bytes(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @print_hex_dump(i8* %9, i32 %10, i32 16, i32 1, i8* %11, i64 %12, i32 1)
ret void
}

LLVM IR (-O2):
define void @print_hex_dump_bytes(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @print_hex_dump(i8* %0, i32 %1, i32 16, i32 1, i8* %2, i64 %3, i32 1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ system(char *);
int set_clickpad_state(const char *state) {
  int sucess = -1;
  if (strcmp(state, "ON") == 0) {
    system("synclient ClickPad=1");
    sucess = 0;
  } else {
    system("synclient ClickPad=0");
    sucess = 0;
  }
  return sucess;
}


x86 assembly (clang, -O0):
<set_clickpad_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1165 <set_clickpad_state+0x45>
lea    0xeaf(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0xc(%rbp)
jmp    1178 <set_clickpad_state+0x58>
lea    0xeac(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_clickpad_state>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xecc(%rip),%rax
lea    0xeda(%rip),%rdi
cmove  %rax,%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ON\00"
@.str.1 = [21 x i8] c"synclient ClickPad=1\00"
@.str.2 = [21 x i8] c"synclient ClickPad=0\00"
define i32 @set_clickpad_state(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %11
9: ; preds = %1
%10 = call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"ON\00"
@.str.1 = [21 x i8] c"synclient ClickPad=1\00"
@.str.2 = [21 x i8] c"synclient ClickPad=0\00"
define i32 @set_clickpad_state(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @system(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int, int);
int /*<<< orphan*/ foo(int);
void fn_14(void) {
  int i;
  for ((i) = (0); (i) < (10); (i++))
    foo(i);
  bar(i, i);
}


x86 assembly (clang, -O0):
<fn_14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    114f <fn_14+0x2f>
mov    -0x4(%rbp),%edi
call   1040 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <fn_14+0xf>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_14>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0x2,%edi
call   1040 <foo@plt>
mov    $0x3,%edi
call   1040 <foo@plt>
mov    $0x4,%edi
call   1040 <foo@plt>
mov    $0x5,%edi
call   1040 <foo@plt>
mov    $0x6,%edi
call   1040 <foo@plt>
mov    $0x7,%edi
call   1040 <foo@plt>
mov    $0x8,%edi
call   1040 <foo@plt>
mov    $0x9,%edi
call   1040 <foo@plt>
mov    $0xa,%edi
mov    $0xa,%esi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @fn_14() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @foo(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
%12 = load i32, i32* %1
%13 = load i32, i32* %1
%14 = call i32 @bar(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @fn_14() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
%3 = tail call i32 @foo(i32 2)
%4 = tail call i32 @foo(i32 3)
%5 = tail call i32 @foo(i32 4)
%6 = tail call i32 @foo(i32 5)
%7 = tail call i32 @foo(i32 6)
%8 = tail call i32 @foo(i32 7)
%9 = tail call i32 @foo(i32 8)
%10 = tail call i32 @foo(i32 9)
%11 = tail call i32 @bar(i32 10, i32 10)
ret void
}
__attribute__((no)) int f1(int n) { return n / 33; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movslq %edi,%rax
imul   $0x3e0f83e1,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = sdiv i32 %0, 33
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fail(const char *msg) {
  if (msg)
    fprintf(stderr, "FAILED: '%s'\n", msg);
  exit(20);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <fail+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x14,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
test   %rdi,%rdi
je     113e <fail+0x1e>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x14,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"FAILED: '%s'\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 @exit(i32 20)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"FAILED: '%s'\0A\00"
define void @fail(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @exit(i32 20)
unreachable
}
void tlib_on_cpu_halted(void) {}


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

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

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

LLVM IR (-O2):
define void @tlib_on_cpu_halted() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__1__GeneralIO__makeOutput();
void LedsP__Led1__makeOutput(void) { Msp430GpioC__1__GeneralIO__makeOutput(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__1__GeneralIO__makeOutput()
ret void
}