xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int pread(int, int *, int, int);
long long read_msr(int fd, int which) {
  uint64_t data = 0;
  uint64_t data_size = pread(fd, &data, sizeof data, which);
  if (data_size != sizeof data) {
    perror("read_msr:pread");
    return -1;
  }
  return (long long)data;
}


x86 assembly (clang, -O0):
<read_msr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%ecx
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1040 <pread@plt>
mov    %eax,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x4,%rax
je     1173 <read_msr+0x53>
lea    0xe9f(%rip),%rdi
call   1030 <perror@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    117b <read_msr+0x5b>
movslq -0x14(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_msr>:
push   %rax
mov    %esi,%ecx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1040 <pread@plt>
cmp    $0x4,%eax
jne    1146 <read_msr+0x26>
movslq 0x4(%rsp),%rax
pop    %rcx
ret
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"read_msr:pread\00"
define i64 @read_msr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @pread(i32 %0, i32* %3, i32 4, i32 %1)
%6 = icmp eq i32 %5, 4
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
br label %12
12: ; preds = %9, %7
%13 = phi i64 [ -1, %7 ], [ %11, %9 ]
ret i64 %13
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int chg_first;
};
typedef TYPE_1__ XIMPreeditDrawCallbackStruct;

/* Variables and functions */
void set_XIMPreeditDrawCallbackStruct_chg_first(void *_p, int _v) {
  ((XIMPreeditDrawCallbackStruct *)_p)->chg_first = (int)_v;
}


x86 assembly (clang, -O0):
<set_XIMPreeditDrawCallbackStruct_chg_first>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XIMPreeditDrawCallbackStruct_chg_first>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XIMPreeditDrawCallbackStruct_chg_first(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %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 i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XIMPreeditDrawCallbackStruct_chg_first(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
void aio_suspend(void *p, int n, const void *p2) { sleep(0); }


x86 assembly (clang, -O0):
<aio_suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <sleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_suspend>:
xor    %edi,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @aio_suspend(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
%7 = call i32 @sleep(i32 0)
ret void
}

LLVM IR (-O2):
define void @aio_suspend(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @sleep(i32 0)
ret void
}
/* Variables and functions */
char *make_scalar(char *, char *);
char *avg(char *field) { return make_scalar("AVG", field); }


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

x86 assembly (clang, -O2):
<avg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <make_scalar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"AVG\00"
define i8* @avg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @make_scalar(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"AVG\00"
define i8* @avg(i8* %0) {
%2 = tail call i8* @make_scalar(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void yaiv_show_usage() {
  fprintf(stdout, "Usage: yaiv <-4|-6> <-a address>\n");
}


x86 assembly (clang, -O0):
<yaiv_show_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaiv_show_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"Usage: yaiv <-4|-6> <-a address>\0A\00"
define void @yaiv_show_usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"Usage: yaiv <-4|-6> <-a address>\0A\00"
define void @yaiv_show_usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned long long checkFileContent(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ convertContent(int /*<<< orphan*/ *, unsigned long long);
int /*<<< orphan*/ *fopen(char *, char *);
int main(int argc, char *argv[]) {
  unsigned long long rowLength;
  FILE *gridFile;
  gridFile = fopen(argv[1], "r");
  rowLength = checkFileContent(gridFile, argv[1]);
  convertContent(gridFile, rowLength);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <checkFileContent@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <convertContent@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xebe(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rsi
mov    %rax,%rdi
call   1040 <checkFileContent@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <convertContent@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = tail call i64 @checkFileContent(i32* %5, i8* %6)
%8 = tail call i32 @convertContent(i32* %5, i64 %7)
ret i32 0
}
void jelly_sleep(struct Jelly *jelly) {}


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

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

LLVM IR (-O0):
%struct.Jelly = type opaque
define void @jelly_sleep(%struct.Jelly* %0) {
%2 = alloca %struct.Jelly*
store %struct.Jelly* %0, %struct.Jelly** %2
ret void
}

LLVM IR (-O2):
%struct.Jelly = type opaque
define void @jelly_sleep(%struct.Jelly* nocapture %0) {
ret void
}
int Int_compare(int *ptr1, int *ptr2) {
  if (*ptr1 == *ptr2)
    return 0;
  return *ptr1 < *ptr2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<Int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <Int_compare+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1148 <Int_compare+0x48>
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Int_compare(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
char *ecalloc(int, int);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *estrdup(const char *source) {
  int ln = strlen(source) + 1;
  char *s = ecalloc(ln, sizeof(char));
  strncpy(s, source, ln);
  return s;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1040 <ecalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
mov    $0x1,%esi
call   1040 <ecalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @estrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @ecalloc(i32 %3, i32 1)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
double R_modeShapeHex(int p, int i, double *L) { return 0.0; }


x86 assembly (clang, -O0):
<R_modeShapeHex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_modeShapeHex>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @R_modeShapeHex(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @R_modeShapeHex(i32 %0, i32 %1, double* nocapture readnone %2) {
ret double 0.000000e+00
}
int fn3(int a, int b) {
  int tem1 = a & b;
  int tem2 = b ^ a;
  return tem1 + tem2;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
int st_ptrhash(x, size)
char *x;
int size;
{ return ((int)((unsigned)(x) >> 2) % size); }


x86 assembly (clang, -O0):
<st_ptrhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_ptrhash>:
mov    %rdi,%rax
shr    $0x2,%eax
xor    %edx,%edx
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @st_ptrhash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
%7 = lshr i32 %6, 2
%8 = load i32, i32* %4
%9 = srem i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @st_ptrhash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 2
%6 = srem i32 %5, %1
ret i32 %6
}
void rop3_143_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_143_0_0>:
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 -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_143_0_0>:
and    (%rdi),%sil
not    %dl
or     %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_143_0_0(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* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_143_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %2, -1
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret void
}
const char *vam_ipc_get_def_file_name(void) {
  return "/var/tmp/"
         ".vamipc_key_file";
}


x86 assembly (clang, -O0):
<vam_ipc_get_def_file_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"/var/tmp/.vamipc_key_file\00"
define i8* @vam_ipc_get_def_file_name() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [26 x i8] c"/var/tmp/.vamipc_key_file\00"
define i8* @vam_ipc_get_def_file_name() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}
int test_imm_1Dint16_mem(short *val) {
  return ((*val) & (-0x1D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Dint16_mem>:
movzwl (%rdi),%eax
test   $0xffe3,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Dint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -29
%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_1Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -29
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((visibility("default"))) void write_IntelHEX(void *ROM, void *RAM,
                                                           char *file) {}


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

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

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

LLVM IR (-O2):
define void @write_IntelHEX(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_signed_char_compare(const void *p1,
                                                  const void *p2, size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_signed_char_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_signed_char_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_signed_char_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_signed_char_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float expf(float);
float gaussian(float const sigma, float const x) {
  float const u = x / sigma;
  return expf(-0.5f * u * u);
}


x86 assembly (clang, -O0):
<gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec7(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1030 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussian>:
divss  %xmm0,%xmm1
movss  0xee4(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @gaussian(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fdiv float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fmul float -5.000000e-01, %9
%11 = load float, float* %5
%12 = fmul float %10, %11
%13 = call float @expf(float %12)
ret float %13
}

LLVM IR (-O2):
define float @gaussian(float %0, float %1) {
%3 = fdiv float %1, %0
%4 = fmul float %3, -5.000000e-01
%5 = fmul float %3, %4
%6 = tail call float @expf(float %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short);
__attribute__((no, noclone)) unsigned short f3(unsigned short x,
                                               unsigned short y) {
  unsigned short r = x - y;
  if (y < r)
    foo(r);
  return r;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    114d <f3+0x3d>
movzwl -0x6(%rbp),%edi
call   1030 <foo@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %edi,%ebx
sub    %esi,%ebx
cmp    %si,%bx
jbe    1122 <f3+0x12>
movzwl %bx,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define zeroext i16 @f3(i16 zeroext %0, i16 zeroext %1) {
%3 = sub i16 %0, %1
%4 = icmp ugt i16 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i16 zeroext %3)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
double mysecond();
int /*<<< orphan*/ printf(char *, double, size_t);
void char_copy2(uintptr_t rbuf, uintptr_t sbuf, size_t size) {
  double t = mysecond();
#pragma vector nontemporal
  memcpy((void *)rbuf, (void *)sbuf, size);
  t = mysecond() - t;
  printf("AFTER Triad elapsed : %f size bytes : %lu \n", t, size);
}


x86 assembly (clang, -O0):
<char_copy2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <mysecond@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    $0x0,%al
call   1030 <mysecond@plt>
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_copy2>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <mysecond@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
xor    %eax,%eax
call   1030 <mysecond@plt>
subsd  0x8(%rsp),%xmm0
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"AFTER Triad elapsed : %f size bytes : %lu \0A\00"
define void @char_copy2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = call double (...) @mysecond()
store double %8, double* %7
%9 = load i64, i64* %4
%10 = inttoptr i64 %9 to i8*
%11 = load i64, i64* %5
%12 = inttoptr i64 %11 to i8*
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %10, i8* %12, i64 %13)
%15 = call double (...) @mysecond()
%16 = load double, double* %7
%17 = fsub double %15, %16
store double %17, double* %7
%18 = load double, double* %7
%19 = load i64, i64* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), double %18, i64 %19)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"AFTER Triad elapsed : %f size bytes : %lu \0A\00"
define void @char_copy2(i64 %0, i64 %1, i64 %2) {
%4 = tail call double (...) @mysecond()
%5 = inttoptr i64 %0 to i8*
%6 = inttoptr i64 %1 to i8*
%7 = tail call i32 @memcpy(i8* %5, i8* %6, i64 %2)
%8 = tail call double (...) @mysecond()
%9 = fsub double %8, %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), double %9, i64 %2)
ret void
}
void gdk_input_condition_get_type() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ abort();
void process_v1_packet(struct msg_digest **mdp) { abort(); }


x86 assembly (clang, -O0):
<process_v1_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<process_v1_packet>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.msg_digest = type { i32 }
define void @process_v1_packet(%struct.msg_digest** %0) {
%2 = alloca %struct.msg_digest**
store %struct.msg_digest** %0, %struct.msg_digest*** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.msg_digest = type { i32 }
define void @process_v1_packet(%struct.msg_digest** nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int /*<<< orphan*/ *, int, int,
                               int /*<<< orphan*/ *, int /*<<< orphan*/);
void test_first_base_is_one(void) {
  int8_t input[] = {0};
  int8_t expected[] = {0};
  test_rebase(1, input, (sizeof(input) / sizeof(input[0])), 10, expected, 0);
}


x86 assembly (clang, -O0):
<test_first_base_is_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%r8
mov    $0x1,%edx
mov    $0xa,%ecx
xor    %r9d,%r9d
mov    %edx,%edi
call   1040 <test_rebase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_first_base_is_one>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
mov    $0x1,%edi
mov    $0x1,%edx
mov    $0xa,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_first_base_is_one() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 1, i32* %5, i32 1, i32 10, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @test_first_base_is_one() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 0, i32* %4
%5 = bitcast [1 x i32]* %2 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %6
%7 = call i32 @test_rebase(i32 1, i32* %4, i32 1, i32 10, i32* %6, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void h265hvcc_set_level_idc(uint8_t *p, uint8_t val) { p[12] = val; }


x86 assembly (clang, -O0):
<h265hvcc_set_level_idc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_level_idc>:
mov    %esi,0x30(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_level_idc(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 12
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_level_idc(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 12
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int *p = NULL;
  printf("%p\n", p);
  printf("%lud\n", sizeof(p));
  int a = 10;
  p = &a;
  printf("%p\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xa,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [6 x i8] c"%lud\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 8)
%4 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
char *adfGetVersionNumber() { return ("0.7.11a"); }


x86 assembly (clang, -O0):
<adfGetVersionNumber>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"0.7.11a\00"
define i8* @adfGetVersionNumber() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"0.7.11a\00"
define i8* @adfGetVersionNumber() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
char getCorrespSpecialChar(char c) {
  if (c == ',') {
    return ',';
  } else if (c == '.') {
    return '.';
  } else if (c == '!') {
    return '!';
  } else if (c == '?') {
    return '?';
  } else if (c == '_') {
    return ' ';
  } else {
    return ';';
  }
}


x86 assembly (clang, -O0):
<getCorrespSpecialChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2c,%eax
jne    1120 <getCorrespSpecialChar+0x20>
movb   $0x2c,-0x1(%rbp)
jmp    117c <getCorrespSpecialChar+0x7c>
movsbl -0x2(%rbp),%eax
cmp    $0x2e,%eax
jne    1136 <getCorrespSpecialChar+0x36>
movb   $0x2e,-0x1(%rbp)
jmp    117c <getCorrespSpecialChar+0x7c>
movsbl -0x2(%rbp),%eax
cmp    $0x21,%eax
jne    114c <getCorrespSpecialChar+0x4c>
movb   $0x21,-0x1(%rbp)
jmp    117c <getCorrespSpecialChar+0x7c>
movsbl -0x2(%rbp),%eax
cmp    $0x3f,%eax
jne    1162 <getCorrespSpecialChar+0x62>
movb   $0x3f,-0x1(%rbp)
jmp    117c <getCorrespSpecialChar+0x7c>
movsbl -0x2(%rbp),%eax
cmp    $0x5f,%eax
jne    1178 <getCorrespSpecialChar+0x78>
movb   $0x20,-0x1(%rbp)
jmp    117c <getCorrespSpecialChar+0x7c>
movb   $0x3b,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCorrespSpecialChar>:
mov    %edi,%eax
lea    -0x21(%rax),%ecx
cmp    $0x3e,%cl
ja     1122 <getCorrespSpecialChar+0x22>
movzbl %cl,%ecx
mov    $0x40002801,%edx
bt     %rcx,%rdx
jae    1119 <getCorrespSpecialChar+0x19>
ret
cmp    $0x3e,%rcx
jne    1122 <getCorrespSpecialChar+0x22>
mov    $0x20,%al
ret
mov    $0x3b,%al
ret

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

LLVM IR (-O2):
define signext i8 @getCorrespSpecialChar(i8 signext %0) {
switch i8 %0, label %3 [
i8 44, label %4
i8 46, label %4
i8 33, label %4
i8 63, label %4
i8 95, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3, %2
%5 = phi i8 [ 32, %2 ], [ 59, %3 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ]
ret i8 %5
}
/* Variables and functions */
int M_PI;
double Deg2Rad(const double deg) { return deg * (M_PI / 180); }


x86 assembly (clang, -O0):
<Deg2Rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Deg2Rad>:
mov    0x2ee1(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @Deg2Rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 180
%6 = sitofp i32 %5 to double
%7 = fmul double %3, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @Deg2Rad(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 180
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ pr_mask(char *);
void sig_alrm(int signo) {
  pr_mask("in sig_alrm(): ");
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"in sig_alrm(): \00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @pr_mask(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, char const *, char const *);
int symlink(const char *existing, const char *new) {
  return syscall(83, existing, new);
}


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

x86 assembly (clang, -O2):
<symlink>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x53,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @symlink(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 83, i8* %0, i8* %1)
ret i32 %3
}
int init_oldrelayfs() { return -1; }


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

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

LLVM IR (-O0):
define i32 @init_oldrelayfs() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @init_oldrelayfs() {
ret i32 -1
}
__attribute__((target("arch=ivybridge,fma4,sse4.2"))) void foo_multi(int i,
                                                                     double d) {
}


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

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

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

LLVM IR (-O2):
define void @foo_multi(i32 %0, double %1) {
ret void
}
void ff_hevc_put_hevc_uni_w_epel_h6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h6_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mt_init();
void exponential_setup(void) { mt_init(); }


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

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

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

LLVM IR (-O2):
define void @exponential_setup() {
%1 = tail call i32 (...) @mt_init()
ret void
}
void *mem_get_ptr(void *ptr) { return (ptr); }


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

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

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

LLVM IR (-O2):
define i8* @mem_get_ptr(i8* readnone returned %0) {
ret i8* %0
}
long f2(long a) { return a & ~0xff000000L; }


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

x86 assembly (clang, -O2):
<f2>:
movabs $0xffffffff00ffffff,%rax
ff ff ff
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @f2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -4278190081
ret i64 %4
}

LLVM IR (-O2):
define i64 @f2(i64 %0) {
%2 = and i64 %0, -4278190081
ret i64 %2
}
/* Variables and functions */
double pow(double, double);
double f4_x6_2(double x) { return pow(x, 6.0) - 2.0; }


x86 assembly (clang, -O0):
<f4_x6_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xec9(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_x6_2>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_x6_2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 6.000000e+00)
%5 = fsub double %4, 2.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @f4_x6_2(double %0) {
%2 = tail call double @pow(double %0, double 6.000000e+00)
%3 = fadd double %2, -2.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int read(int, int *, int);
int main() {
  int ch[2];
  int fd = open("./somefile", O_RDONLY);
  return read(fd, ch, 2) != 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1030 <read@plt>
cmp    $0x2,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"./somefile\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @O_RDONLY
%5 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = call i32 @read(i32 %6, i32* %7, i32 2)
%9 = icmp ne i32 %8, 2
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"./somefile\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = call i32 @read(i32 %4, i32* %5, i32 2)
%7 = icmp ne i32 %6, 2
%8 = zext i1 %7 to i32
ret i32 %8
}
int max(i, j)
int i, j;
{
  if (i > j)
    return (i);
  return (j);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void foo_1_2_1_1_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM1_TRG_COM_TIM11_IRQHandler() {
  default_handler();
}


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

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

LLVM IR (-O0):
define weak void @TIM1_TRG_COM_TIM11_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM1_TRG_COM_TIM11_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void CClinkern_flipper_free_world() { return; }


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

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

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

LLVM IR (-O2):
define void @CClinkern_flipper_free_world() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BackupPC();
int /*<<< orphan*/ Exception(int);
void op_illg(void) {
  BackupPC();
  Exception(4);
}


x86 assembly (clang, -O0):
<op_illg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <BackupPC@plt>
mov    $0x4,%edi
call   1030 <Exception@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_illg>:
push   %rax
xor    %eax,%eax
call   1040 <BackupPC@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <Exception@plt>

LLVM IR (-O0):
define void @op_illg() {
%1 = call i32 (...) @BackupPC()
%2 = call i32 @Exception(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_illg() {
%1 = tail call i32 (...) @BackupPC()
%2 = tail call i32 @Exception(i32 4)
ret void
}