xunge/DecIR huggingface dataset:
/* Variables and functions */
float acosf(float const);
void glmACos3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = acosf(x[i]);
}


x86 assembly (clang, -O0):
<glmACos3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmACos3f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <acosf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmACos3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmACos3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <acosf@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <acosf@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <acosf@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmACos3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @acosf(float %13)
%15 = load float*, float** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds float, float* %15, i64 %16
store float %14, float* %17
br label %18
18: ; preds = %9
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmACos3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @acosf(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @acosf(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @acosf(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
void WIFI_TEST_CMD(char *cmdStr) {}


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

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

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

LLVM IR (-O2):
define void @WIFI_TEST_CMD(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_insert(struct genlist *, void *, int /*<<< orphan*/);
void genlist_prepend(struct genlist *pgenlist, void *data) {
  genlist_insert(pgenlist, data, 0);
}


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

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

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

LLVM IR (-O2):
%struct.genlist = type { i32 }
define void @genlist_prepend(%struct.genlist* %0, i8* %1) {
%3 = tail call i32 @genlist_insert(%struct.genlist* %0, i8* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drfti1(int, double *, int *);
void __ogg_fdrffti(int n, double *wsave, int *ifac) {
  if (n == 1)
    return;
  drfti1(n, wsave + n, ifac);
}


x86 assembly (clang, -O0):
<__ogg_fdrffti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1132 <__ogg_fdrffti+0x22>
jmp    114d <__ogg_fdrffti+0x3d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <drfti1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ogg_fdrffti>:
cmp    $0x1,%edi
jne    1116 <__ogg_fdrffti+0x6>
ret
movslq %edi,%rax
lea    (%rsi,%rax,8),%rsi
jmp    1030 <drfti1@plt>

LLVM IR (-O0):
define void @__ogg_fdrffti(i32 %0, double* %1, i32* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32*
store i32 %0, i32* %4
store double* %1, double** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %3
br label %18
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load double*, double** %5
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load i32*, i32** %6
%17 = call i32 @drfti1(i32 %11, double* %15, i32* %16)
br label %18
18: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @__ogg_fdrffti(i32 %0, double* %1, i32* %2) {
%4 = icmp eq i32 %0, 1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds double, double* %1, i64 %6
%8 = tail call i32 @drfti1(i32 %0, double* %7, i32* %2)
br label %9
9: ; preds = %3, %5
ret void
}
/* Variables and functions */
int add_numbers(int, int);
int /*<<< orphan*/ output_sum(int);
int subtract_numbers(int, int);
int main() {
  int sum;
  sum = add_numbers(45, 74);
  output_sum(sum);
  sum = subtract_numbers(66, 12);
  output_sum(sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2d,%edi
mov    $0x4a,%esi
call   1030 <add_numbers@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <output_sum@plt>
mov    $0x42,%edi
mov    $0xc,%esi
call   1050 <subtract_numbers@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <output_sum@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2d,%edi
mov    $0x4a,%esi
call   1030 <add_numbers@plt>
mov    %eax,%edi
call   1040 <output_sum@plt>
mov    $0x42,%edi
mov    $0xc,%esi
call   1050 <subtract_numbers@plt>
mov    %eax,%edi
call   1040 <output_sum@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @add_numbers(i32 45, i32 74)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @output_sum(i32 %4)
%6 = call i32 @subtract_numbers(i32 66, i32 12)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @output_sum(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add_numbers(i32 45, i32 74)
%2 = tail call i32 @output_sum(i32 %1)
%3 = tail call i32 @subtract_numbers(i32 66, i32 12)
%4 = tail call i32 @output_sum(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int devnode_acl_all(const char *seat, bool flush, bool del, uid_t old_uid,
                    bool add, uid_t new_uid) {
  return 0;
}


x86 assembly (clang, -O0):
<devnode_acl_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @devnode_acl_all(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i32 0
}
int bar(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int tuner_set_freq(void *, unsigned int);
signed int bbm_com_tuner_set_freq(void *handle, unsigned int freq) {
  signed int res;
  res = tuner_set_freq(handle, freq);
  return res;
}


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

x86 assembly (clang, -O2):
<bbm_com_tuner_set_freq>:
jmp    1030 <tuner_set_freq@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_tuner_set_freq(i8* %0, i32 %1) {
%3 = tail call i32 @tuner_set_freq(i8* %0, i32 %1)
ret i32 %3
}
void tr_write_dummy_func(void) {}


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

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

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

LLVM IR (-O2):
define void @tr_write_dummy_func() {
ret void
}
void libsoc_gpio_debug(const char *func, int gpio, char *format, ...) {}


x86 assembly (clang, -O0):
<libsoc_gpio_debug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @libsoc_gpio_debug(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
void _erase(char *str, int n) {
  while (n > 0) {
    n--;
    str[n] = '\0';
  }
}


x86 assembly (clang, -O0):
<_erase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    112f <_erase+0x2f>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    110b <_erase+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_erase>:
test   %esi,%esi
jle    1122 <_erase+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @_erase(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @_erase(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
void util_fail_(const char *file, int line, const char *func, const char *msg) {
  fprintf(stderr, "%s, %i (%s):\n%s\n", file, line, func, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<util_fail_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<util_fail_>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s, %i (%s):\0A%s\0A\00"
define void @util_fail_(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s, %i (%s):\0A%s\0A\00"
define void @util_fail_(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_alarm(int signo) {
  printf("in sig_alarm\n");
  return;
}


x86 assembly (clang, -O0):
<sig_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"in sig_alarm\0A\00"
define void @sig_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"in sig_alarm\00"
define void @sig_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void avpriv_dict_set_timestamp() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_dict_set_timestamp() {
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nfs_wb_all(struct inode *);
int nfs_inode_return_delegation(struct inode *inode) {
  nfs_wb_all(inode);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.inode = type { i32 }
define i32 @nfs_inode_return_delegation(%struct.inode* %0) {
%2 = tail call i32 @nfs_wb_all(%struct.inode* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
int kill(pid_t pid, int sig) { return EINVAL; }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
ret i32 %5
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *sfd_strltrim(char const *);
char *sfd_strrtrim(char *);
char *sfd_strtrim(const char *s) {
  char *b1 = sfd_strltrim(s), *b2 = sfd_strrtrim(b1);
  free(b1);
  return b2;
}


x86 assembly (clang, -O0):
<sfd_strtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <sfd_strltrim@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sfd_strrtrim@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_strtrim>:
push   %r14
push   %rbx
push   %rax
call   1050 <sfd_strltrim@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <sfd_strrtrim@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sfd_strtrim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @sfd_strltrim(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @sfd_strrtrim(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @sfd_strtrim(i8* %0) {
%2 = tail call i8* @sfd_strltrim(i8* %0)
%3 = tail call i8* @sfd_strrtrim(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %3
}
int get_pclk2(void) { return 72000000; }


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

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

LLVM IR (-O0):
define i32 @get_pclk2() {
ret i32 72000000
}

LLVM IR (-O2):
define i32 @get_pclk2() {
ret i32 72000000
}
void WaitForIpcFlag(unsigned long int flag) {
  while (((*((volatile unsigned long *)(0x400FB700 + 0x000000004))) & flag) ==
         0) {
  }
  (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |= flag;
  return;
}


x86 assembly (clang, -O0):
<WaitForIpcFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fb704,%eax
mov    (%rax),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
jne    1123 <WaitForIpcFlag+0x23>
jmp    1108 <WaitForIpcFlag+0x8>
mov    -0x8(%rbp),%rax
mov    $0x400fb700,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb700,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitForIpcFlag>:
mov    0x400fb704,%rax
40
and    %rdi,%rax
je     1100 <WaitForIpcFlag>
or     %rdi,0x400fb700
40
ret

LLVM IR (-O0):
define void @WaitForIpcFlag(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 1074771716 to i64*)
%5 = load i64, i64* %2
%6 = and i64 %4, %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i64, i64* %2
%11 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%12 = or i64 %11, %10
store volatile i64 %12, i64* inttoptr (i64 1074771712 to i64*)
ret void
}

LLVM IR (-O2):
define void @WaitForIpcFlag(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1074771716 to i64*)
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%8 = or i64 %7, %0
store volatile i64 %8, i64* inttoptr (i64 1074771712 to i64*)
ret void
}
/* Type definitions */
typedef unsigned int u_char;

/* Variables and functions */
u_char getbyte(unsigned int hex) {
  int mask = 0x000000FF;
  return hex & mask;
}


x86 assembly (clang, -O0):
<getbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbyte>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getbyte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 255, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @getbyte(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
int security_socket_bind(struct socket *sock, struct sockaddr *address,
                         int addrlen) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.socket = type opaque
%struct.sockaddr = type opaque
define i32 @security_socket_bind(%struct.socket* %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca %struct.socket*
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store %struct.socket* %0, %struct.socket** %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.socket = type opaque
%struct.sockaddr = type opaque
define i32 @security_socket_bind(%struct.socket* nocapture readnone %0, %struct.sockaddr* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void showstr(char *str, int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("0x%02x ", str[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<showstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <showstr+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <showstr+0x16>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showstr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <showstr+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <showstr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"0x%02x \00"
define void @showstr(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_single_linked_list();
int main(int argc, char **argv) {
  test_single_linked_list();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_single_linked_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_single_linked_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_single_linked_list()
ret i32 0
}
/* Type definitions */
struct CWX_PG_WRITER {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reset(struct CWX_PG_WRITER *);
void cwx_pg_writer_begin_pack(struct CWX_PG_WRITER *writer) { reset(writer); }


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

x86 assembly (clang, -O2):
<cwx_pg_writer_begin_pack>:
jmp    1030 <reset@plt>

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

LLVM IR (-O2):
%struct.CWX_PG_WRITER = type { i32 }
define void @cwx_pg_writer_begin_pack(%struct.CWX_PG_WRITER* %0) {
%2 = tail call i32 @reset(%struct.CWX_PG_WRITER* %0)
ret void
}
int test_imm_5Eint16_reg(short val) {
  return ((val) & (-0x5E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Eint16_reg>:
test   $0xffa2,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -94
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double cos(double);
double cosd(double ang) { return cos(ang / 57.29577951); }


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

x86 assembly (clang, -O2):
<cosd>:
divsd  0xee8(%rip),%xmm0
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @cosd(double %0) {
%2 = fdiv double %0, 0x404CA5DC1A5D2372
%3 = tail call double @cos(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printer_off();
void op_proff() { printer_off(); }


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

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

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

LLVM IR (-O2):
define void @op_proff() {
%1 = tail call i32 (...) @printer_off()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exvwarning(int /*<<< orphan*/, char const *,
                              int /*<<< orphan*/);
void sh_vwarn(const char *fmt, va_list ap) { exvwarning(errno, fmt, ap); }


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

x86 assembly (clang, -O2):
<sh_vwarn>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <exvwarning@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @sh_vwarn(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @errno
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @exvwarning(i32 %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @sh_vwarn(i8* %0, i32 %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @exvwarning(i32 %3, i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct Message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_materials(struct Message *);
void cmd_materials(int pindex __attribute__((unused)), struct Message *msg) {
  print_materials(msg);
}


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

x86 assembly (clang, -O2):
<cmd_materials>:
mov    %rsi,%rdi
jmp    1030 <print_materials@plt>

LLVM IR (-O0):
%struct.Message = type { i32 }
define void @cmd_materials(i32 %0, %struct.Message* %1) {
%3 = alloca i32
%4 = alloca %struct.Message*
store i32 %0, i32* %3
store %struct.Message* %1, %struct.Message** %4
%5 = load %struct.Message*, %struct.Message** %4
%6 = call i32 @print_materials(%struct.Message* %5)
ret void
}

LLVM IR (-O2):
%struct.Message = type { i32 }
define void @cmd_materials(i32 %0, %struct.Message* %1) {
%3 = tail call i32 @print_materials(%struct.Message* %1)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t UARTParityModeGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x0000002C))) &
          (0x00000080 | 0x00000004 | 0x00000002));
}


x86 assembly (clang, -O0):
<UARTParityModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
and    $0x86,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x2c(%rax),%rax
and    $0x86,%eax
ret

LLVM IR (-O0):
define i64 @UARTParityModeGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 134
ret i64 %7
}

LLVM IR (-O2):
define i64 @UARTParityModeGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 134
ret i64 %7
}
int do_567() { return 567; }


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

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

LLVM IR (-O0):
define i32 @do_567() {
ret i32 567
}

LLVM IR (-O2):
define i32 @do_567() {
ret i32 567
}
void rop3_183_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_183_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_183_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %dl,%cl
and    %sil,%cl
mov    %ecx,%eax
xor    %sil,%al
or     %dl,%cl
not    %cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_183_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_183_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %1
%8 = or i8 %6, %2
%9 = xor i8 %8, -1
%10 = xor i8 %1, -1
%11 = and i8 %10, %2
%12 = and i8 %11, %4
%13 = or i8 %12, %9
%14 = or i8 %13, %7
store i8 %14, i8* %0
ret void
}
int test_imm_8Auint16_mem(unsigned short *val) {
  return ((*val) & (0x8A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Auint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x8a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Auint16_mem>:
testb  $0x8a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 138
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int add_more(int);
int /*<<< orphan*/ primary_four(int);
int /*<<< orphan*/ primary_three(int);
int adagain(int input) {
  static int one = 1;
  int two = 2;
  two += input;
  two += one;
  two = add_more(two);
  primary_three(two);
  primary_four(two);
  return two;
}


x86 assembly (clang, -O0):
<adagain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ee7(%rip),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <add_more@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <primary_three@plt>
mov    -0x8(%rbp),%edi
call   1030 <primary_four@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adagain>:
push   %rbx
add    $0x3,%edi
call   1040 <add_more@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <primary_three@plt>
mov    %ebx,%edi
call   1030 <primary_four@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@adagain.one = internal global i32 1
define i32 @adagain(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* @adagain.one
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @add_more(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @primary_three(i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @primary_four(i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @adagain(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = tail call i32 @add_more(i32 %2)
%4 = tail call i32 @primary_three(i32 %3)
%5 = tail call i32 @primary_four(i32 %3)
ret i32 %3
}
/* Variables and functions */
int divides_l(long, long);
bool is_evenly_divisible_by_l(long n, long m) { return divides_l(m, n); }


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

x86 assembly (clang, -O2):
<is_evenly_divisible_by_l>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <divides_l@plt>

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

LLVM IR (-O2):
define i32 @is_evenly_divisible_by_l(i64 %0, i64 %1) {
%3 = tail call i32 @divides_l(i64 %1, i64 %0)
ret i32 %3
}
/* Type definitions */
struct sigaction {
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void noZombies() {
  struct sigaction sa;
  sa.sa_handler = SIG_IGN;
  sigemptyset(&sa.sa_mask);
  sa.sa_flags = 0;
  (void)sigaction(SIGCHLD, &sa, NULL);
}


x86 assembly (clang, -O0):
<noZombies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,-0x10(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noZombies>:
sub    $0x18,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
@SIGCHLD = global i32 0
define void @noZombies() {
%1 = alloca %struct.sigaction
%2 = load i32, i32* @SIG_IGN
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 2
store i32 %2, i32* %3
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
%5 = call i32 @sigemptyset(i32* %4)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i64 0, i64* %6
%7 = load i32, i32* @SIGCHLD
%8 = call i32 @sigaction(i32 %7, %struct.sigaction* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
@SIGCHLD = global i32 0
define void @noZombies() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SIG_IGN
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 2
store i32 %3, i32* %4
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 1
%6 = call i32 @sigemptyset(i32* %5)
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i64 0, i64* %7
%8 = load i32, i32* @SIGCHLD
%9 = call i32 @sigaction(i32 %8, %struct.sigaction* %1, i32* null)
ret void
}
extern double s1d1(float s1, double d1) { return s1 + d1; }


x86 assembly (clang, -O0):
<s1d1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s1d1>:
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @s1d1(float %0, double %1) {
%3 = alloca float
%4 = alloca double
store float %0, float* %3
store double %1, double* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load double, double* %4
%8 = fadd double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @s1d1(float %0, double %1) {
%3 = fpext float %0 to double
%4 = fadd double %3, %1
ret double %4
}
void gtk_paint_diamond() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paint_diamond() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ statements();
int main(void) { statements(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @statements()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @statements()
ret i32 0
}
int my_compare(unsigned int key1, unsigned int key2) {
  return ((key1 == key2) ? (0) : ((key1 < key2) ? (-1) : (1)));
}


x86 assembly (clang, -O0):
<my_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1120 <my_compare+0x20>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <my_compare+0x38>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovb  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_compare>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setae  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_compare(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp ult i32 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 1
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ 0, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @my_compare(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp ult i32 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int sweep_define_parameters_numerically(int nq, int nv, int np, int *pars) {
  int fail = 0;
  int nqvp[3];
  double *c;
  nqvp[0] = nq;
  nqvp[1] = nv;
  nqvp[2] = np;
  fail = _ada_use_c2phc4c(610, nqvp, pars, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_define_parameters_numerically>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0x262,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_define_parameters_numerically>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x262,%edi
mov    %rcx,%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_define_parameters_numerically(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca [3 x i32]
%11 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
store i32 0, i32* %9
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%19 = load i32*, i32** %8
%20 = load double*, double** %11
%21 = call i32 @_ada_use_c2phc4c(i32 610, i32* %18, i32* %19, double* %20, i32 0)
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @sweep_define_parameters_numerically(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc4c(i32 610, i32* %7, i32* %3, double* undef, i32 0)
ret i32 %10
}