xunge/DecIR huggingface dataset:
void copiaAtrib(double *var1, double *var2) {
  *var1 = *var2;
  return;
}


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

x86 assembly (clang, -O2):
<copiaAtrib>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @copiaAtrib(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = load double*, double** %3
store double %6, double* %7
ret void
}

LLVM IR (-O2):
define void @copiaAtrib(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
before() { echo("Hello"); }


x86 assembly (clang, -O0):
<before>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <echo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @before() {
%1 = alloca i32
%2 = call i32 @echo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @before() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void stap_task_finder_post_init(void) { ; }


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

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

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

LLVM IR (-O2):
define void @stap_task_finder_post_init() {
ret void
}
/* Variables and functions */
int f();
int f2() {
  int a = 42;
  int b = 35;
  a = f();
  b = f();
  if (!(b < 0))
    return b;
  return 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a,-0x8(%rbp)
movl   $0x23,-0xc(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     114f <f2+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <f2+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1030 <f@plt>
test   %eax,%eax
cmovs  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 42, i32* %2
store i32 35, i32* %3
%4 = call i32 (...) @f()
store i32 %4, i32* %2
%5 = call i32 (...) @f()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = load i32, i32* %3
store i32 %9, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @f2() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @f()
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
int getLength(int number) {
  int length = 0;
  while (number > 0) {
    length++;
    number /= 10;
  }
  return length;
}


x86 assembly (clang, -O0):
<getLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <getLength+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <getLength+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLength>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <getLength+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <getLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @getLength(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ rank(long, double *, long *);
int /*<<< orphan*/ rank2index(long, long *);
void indexx(long nmax, double *x, long *list) {
  rank(nmax, x, list);
  rank2index(nmax, list);
}


x86 assembly (clang, -O0):
<indexx>:
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 <rank@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <rank2index@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexx>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <rank@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rank2index@plt>

LLVM IR (-O0):
define void @indexx(i64 %0, double* %1, i64* %2) {
%4 = alloca i64
%5 = alloca double*
%6 = alloca i64*
store i64 %0, i64* %4
store double* %1, double** %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load double*, double** %5
%9 = load i64*, i64** %6
%10 = call i32 @rank(i64 %7, double* %8, i64* %9)
%11 = load i64, i64* %4
%12 = load i64*, i64** %6
%13 = call i32 @rank2index(i64 %11, i64* %12)
ret void
}

LLVM IR (-O2):
define void @indexx(i64 %0, double* %1, i64* %2) {
%4 = tail call i32 @rank(i64 %0, double* %1, i64* %2)
%5 = tail call i32 @rank2index(i64 %0, i64* %2)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int is_dir(char *fn) {
  struct stat statbuf;
  if (stat(fn, &statbuf) < 0)
    return 0;
  return S_ISDIR(statbuf.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    114f <is_dir+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_dir+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1138 <is_dir+0x18>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void die(int err, const char *msg) {
  if (err != 0)
    perror(msg);
  else
    fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1157 <die+0x27>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
jmp    1170 <die+0x40>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rsi,%rdx
test   %edi,%edi
je     114a <die+0x1a>
mov    %rdx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @arm_early_mmu_cache_invalidate() {
ret void
}
int test_imm_F8int32_mem(int *val) {
  return ((*val) & (0xF8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F8int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 248
%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_F8int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 248
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(char *, int, unsigned int, int /*<<< orphan*/ *);
unsigned lzw_readbuf(void *stream, char *buf, unsigned size) {
  return fread(buf, 1, size, (FILE *)stream);
}


x86 assembly (clang, -O0):
<lzw_readbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzw_readbuf>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i32 @lzw_readbuf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = call i32 @fread(i8* %7, i32 1, i32 %8, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @lzw_readbuf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fread(i8* %1, i32 1, i32 %2, i32* %4)
ret i32 %5
}
int _fputc(c, fp)
struct _buf *fp;
{
  if (c == '\n')
    if (fputc('\r', fp) == -1)
      return -1;
  if (fputc(c, fp) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<_fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1153 <_fputc+0x43>
mov    -0x10(%rbp),%rsi
mov    $0xd,%edi
mov    $0x0,%al
call   1030 <fputc@plt>
cmp    $0xffffffff,%eax
jne    114e <_fputc+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <_fputc+0x6d>
jmp    1153 <_fputc+0x43>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
cmp    $0xffffffff,%eax
jne    1176 <_fputc+0x66>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <_fputc+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fputc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0xa,%edi
jne    1131 <_fputc+0x21>
mov    $0xd,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fputc@plt>
cmp    $0xffffffff,%eax
je     114b <_fputc+0x3b>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fputc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
jmp    1150 <_fputc+0x40>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct._buf = type opaque
define i32 @_fputc(i32 %0, %struct._buf* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct._buf*
store i32 %0, i32* %4
store %struct._buf* %1, %struct._buf** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load %struct._buf*, %struct._buf** %5
%10 = call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 13, %struct._buf* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %3
br label %21
13: ; preds = %8
br label %14
14: ; preds = %13, %2
%15 = load i32, i32* %4
%16 = load %struct._buf*, %struct._buf** %5
%17 = call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %15, %struct._buf* %16)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 -1, i32* %3
br label %21
20: ; preds = %14
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct._buf = type opaque
define i32 @_fputc(i32 %0, %struct._buf* %1) {
%3 = icmp eq i32 %0, 10
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 13, %struct._buf* %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %4, %2
%8 = tail call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %0, %struct._buf* %1)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ -1, %4 ], [ %10, %7 ]
ret i32 %12
}
int max(int a, int b, int c) {
  if (a > b) {
    if (c > a) {
      return c;
    } else {
      return a;
    }
  } else {
    if (c > b) {
      return c;
    } else {
      return b;
    }
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <max+0x3b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1130 <max+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1152 <max+0x52>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %0
%5 = select i1 %4, i32 %2, i32 %0
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numero;
  scanf("%d", &numero);
  printf("%d", numero % 101);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rsi
imul   $0x288df0cb,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
imul   $0x65,%eax,%eax
sub    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 101
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 101
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_add_atRi(char *str, unsigned char i) {
  sprintf(str, "ADD   A, @R%X                    ", i);
}


x86 assembly (clang, -O0):
<sprint_add_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_add_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"ADD A, @R%X \00"
define void @sprint_add_atRi(i8* %0, i8 zeroext %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 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"ADD A, @R%X \00"
define void @sprint_add_atRi(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
int test_imm_D9uint16_mem(unsigned short *val) {
  return ((*val) & (-0xD9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D9uint16_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, -217
%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_D9uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -217
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double cos(double);
double sqrt(double);
double wet_mapping_function(double elevation) {
  double d = cos(elevation);
  d /= 1.000282213715744;
  return (1.0 / sqrt(1.0 - d * d));
}


x86 assembly (clang, -O0):
<wet_mapping_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe81(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wet_mapping_function>:
push   %rax
call   1030 <cos@plt>
movapd %xmm0,%xmm1
divsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xeca(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1156 <wet_mapping_function+0x36>
sqrtsd %xmm0,%xmm0
jmp    1163 <wet_mapping_function+0x43>
call   1040 <sqrt@plt>
movsd  0xea5(%rip),%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @wet_mapping_function(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @cos(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fdiv double %6, 0x3FF00127EC2ADFA8
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double 1.000000e+00)
%12 = call double @sqrt(double %11)
%13 = fdiv double 1.000000e+00, %12
ret double %13
}

LLVM IR (-O2):
define double @wet_mapping_function(double %0) {
%2 = tail call double @cos(double %0)
%3 = fdiv double %2, 0x3FF00127EC2ADFA8
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 1.000000e+00)
%6 = tail call double @sqrt(double %5)
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char colour;
  scanf(" %c", &colour);
  printf("I am A. I play %c. \n", colour);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %c\00"
@.str.1 = [21 x i8] c"I am A. I play %c. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %c\00"
@.str.1 = [21 x i8] c"I am A. I play %c. \0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8 signext %3)
ret i32 0
}
int test_imm_15uint32_reg(unsigned int val) {
  return ((val) & (0x15 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_15uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x15,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_15uint32_reg(i32 %0) {
%2 = and i32 %0, 21
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int getlet(char *);
int move_or_shoot() {
  int c;
badin:
  c = getlet("Shoot or Move (S-M)");
  if (c == 'S')
    return (1);
  else if (c == 'M')
    return (0);
  else
    goto badin;
}


x86 assembly (clang, -O0):
<move_or_shoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getlet@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x53,-0x8(%rbp)
jne    113d <move_or_shoot+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1158 <move_or_shoot+0x48>
cmpl   $0x4d,-0x8(%rbp)
jne    1153 <move_or_shoot+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1158 <move_or_shoot+0x48>
jmp    1118 <move_or_shoot+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_or_shoot>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getlet@plt>
cmp    $0x4d,%eax
je     1139 <move_or_shoot+0x29>
cmp    $0x53,%eax
jne    1120 <move_or_shoot+0x10>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Shoot or Move (S-M)\00"
define i32 @move_or_shoot() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %12, %0
%4 = call i32 @getlet(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 83
br i1 %6, label %7, label %8
7: ; preds = %3
store i32 1, i32* %1
br label %13
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 77
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %1
br label %13
12: ; preds = %8
br label %3
13: ; preds = %11, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [20 x i8] c"Shoot or Move (S-M)\00"
define i32 @move_or_shoot() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @getlet(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
switch i32 %2, label %1 [
i32 83, label %3
i32 77, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = 2147483647;
  printf("int:    %d\n", a);
  a += 1;
  printf("int:    %d\n", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"int: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 -2147483648)
ret i32 0
}
int main() {
  unsigned long test = -1;
  return -test;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
xor    %eax,%eax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 0, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int pow(int, int);
int round_to_nearest_power(int num, int base) {
  int exp = 0;
  while (pow(base, exp) <= num) {
    exp++;
  }
  return pow(base, exp);
}


x86 assembly (clang, -O0):
<round_to_nearest_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <pow@plt>
cmp    -0x4(%rbp),%eax
jg     1147 <round_to_nearest_power+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <round_to_nearest_power+0x15>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_nearest_power>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
mov    $0xffffffff,%ebp
xchg   %ax,%ax
add    $0x1,%ebp
mov    %r14d,%edi
mov    %ebp,%esi
call   1030 <pow@plt>
cmp    %ebx,%eax
jle    1120 <round_to_nearest_power+0x10>
mov    %r14d,%edi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define i32 @round_to_nearest_power(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %7, %3 ]
%5 = tail call i32 @pow(i32 %1, i32 %4)
%6 = icmp sgt i32 %5, %0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @pow(i32 %1, i32 %4)
ret i32 %9
}
/* Variables and functions */
long double log10l(long double);
long double intr_wrap_057(long double p1) { return log10l(p1); }


x86 assembly (clang, -O0):
<intr_wrap_057>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log10l@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_057>:
jmp    1030 <log10l@plt>

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_057(x86_fp80 %0) {
%2 = tail call x86_fp80 @log10l(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mtest\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"usage: mtest\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t G(uint32_t B, uint32_t C, uint32_t D) { return (B & D) | (C & ~D); }


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

x86 assembly (clang, -O2):
<G>:
mov    %edi,%eax
xor    %esi,%eax
and    %edx,%eax
xor    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @G(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %0
%5 = xor i32 %2, -1
%6 = and i32 %5, %1
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned int xlc_double_to_u32(double);
int main(int argc, char **argv) {
  unsigned int r = xlc_double_to_u32(0.7);
  if (r == 0)
    printf("pass\n");
  else
    printf("fail\n");
  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)
movsd  0xec2(%rip),%xmm0
call   1040 <xlc_double_to_u32@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1161 <main+0x41>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <main+0x4d>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <xlc_double_to_u32@plt>
test   %eax,%eax
lea    0xed6(%rip),%rax
lea    0xeca(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pass\0A\00"
@.str.1 = [6 x i8] c"fail\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @xlc_double_to_u32(double 0x3FE6666666666666)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"fail\00"
@str.2 = [5 x i8] c"pass\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @xlc_double_to_u32(double 0x3FE6666666666666)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
void cbt_add(struct cbt_node *node, int index, char elem) {}


x86 assembly (clang, -O0):
<cbt_add>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.cbt_node = type opaque
define void @cbt_add(%struct.cbt_node* nocapture %0, i32 %1, i8 signext %2) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t UARTFlowControlGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000030))) &
          (0x00008000 | 0x00004000));
}


x86 assembly (clang, -O0):
<UARTFlowControlGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
and    $0xc000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFlowControlGet>:
movslq %edi,%rcx
mov    $0xc000,%eax
and    0x30(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @UARTFlowControlGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 49152
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTFlowControlGet(i32 %0) {
%2 = add nsw i32 %0, 48
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 49152
ret i32 %6
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createTanHExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x0009);
}


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

x86 assembly (clang, -O2):
<createTanHExpression>:
mov    $0x9,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

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

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createTanHExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 9)
ret %struct.memorycontainer* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_vala_comments() {
  test_parser_verify_parse(test_parser_sourcefile("vala", " //comment"), "vala",
                           "", "//comment", 0);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"vala\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_vala_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int consensus_method_is_supported(int method) {
  return (method >= 1) && (method <= 17);
}


x86 assembly (clang, -O0):
<consensus_method_is_supported>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <consensus_method_is_supported+0x20>
cmpl   $0x11,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<consensus_method_is_supported>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x11,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @consensus_method_is_supported(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 17
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ wborder(int /*<<< orphan*/ *, char, char, char, char, char,
                           char, char, char);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void destroy_win(WINDOW *local_win) {
  wborder(local_win, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
  wrefresh(local_win);
  delwin(local_win);
}


x86 assembly (clang, -O0):
<destroy_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x20,(%rsp)
movl   $0x20,0x8(%rsp)
movl   $0x20,0x10(%rsp)
call   1030 <wborder@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
call   1050 <delwin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_win>:
push   %rbx
mov    %rdi,%rbx
sub    $0x8,%rsp
mov    $0x20,%esi
mov    $0x20,%edx
mov    $0x20,%ecx
mov    $0x20,%r8d
mov    $0x20,%r9d
push   $0x20
push   $0x20
push   $0x20
call   1030 <wborder@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <delwin@plt>

LLVM IR (-O0):
define void @destroy_win(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @wborder(i32* %3, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32)
%5 = load i32*, i32** %2
%6 = call i32 @wrefresh(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @delwin(i32* %7)
ret void
}

LLVM IR (-O2):
define void @destroy_win(i32* %0) {
%2 = tail call i32 @wborder(i32* %0, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32)
%3 = tail call i32 @wrefresh(i32* %0)
%4 = tail call i32 @delwin(i32* %0)
ret void
}
int fll1(int j, signed char *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fll1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fll1>:
movsbl (%rsi,%rdx,1),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fll1(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @fll1(i32 %0, i8* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, %0
ret i32 %7
}
int foo(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
void __DELETE_org_xmlvm_runtime_Mutex(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_org_xmlvm_runtime_Mutex(i8* nocapture %0, i8* nocapture %1) {
ret void
}