xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Welcome to the Factory Storage Authentication System (FSAS).\n");
  printf("For obvious reasons, you should login before attempting to access "
         "the system.\n");
  printf("Any attempt to trick the authentication system will result in a "
         "lawsuite.\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Welcome to the Factory Storage Authentication System (FSAS).\0A\00"
@.str.1 = [79 x i8] c"For obvious reasons, you should login before attempting to access the system.\0A\00"
@.str.2 = [75 x i8] c"Any attempt to trick the authentication system will result in a lawsuite.\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"Welcome to the Factory Storage Authentication System (FSAS).\00"
@str.3 = [78 x i8] c"For obvious reasons, you should login before attempting to access the system.\00"
@str.4 = [74 x i8] c"Any attempt to trick the authentication system will result in a lawsuite.\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.4, i64 0, i64 0))
ret void
}
double TempEfromTempS(double TempS, double HeightEye, double Lapse) {
  return TempS - Lapse * HeightEye;
}


x86 assembly (clang, -O0):
<TempEfromTempS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TempEfromTempS>:
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @TempEfromTempS(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double %7)
ret double %11
}

LLVM IR (-O2):
define double @TempEfromTempS(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = tail call double @llvm.fmuladd.f64(double %4, double %1, double %0)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Usage:\n");
  printf("kbd_backlight [-e | -d | -l<level>]\n");
  printf("  where <level> is a number between 0 and 100.\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [37 x i8] c"kbd_backlight [-e | -d | -l<level>]\0A\00"
@.str.2 = [48 x i8] c" where <level> is a number between 0 and 100.\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.3 = [36 x i8] c"kbd_backlight [-e | -d | -l<level>]\00"
@str.4 = [47 x i8] c" where <level> is a number between 0 and 100.\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __cmpdi2(long long, long long);
int _COM_CMPEQ64(long long a, long long b) { return __cmpdi2(a, b) == 1; }


x86 assembly (clang, -O0):
<_COM_CMPEQ64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__cmpdi2@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CMPEQ64>:
push   %rax
call   1030 <__cmpdi2@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_COM_CMPEQ64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @__cmpdi2(i64 %5, i64 %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_COM_CMPEQ64(i64 %0, i64 %1) {
%3 = tail call i32 @__cmpdi2(i64 %0, i64 %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *arg) {
  long tid = (long)arg;
  printf("Alo da thread %ld\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Alo da thread %ld\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [19 x i8] c"Alo da thread %ld\0A\00"
define noalias i8* @PrintHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
char *xstrdup(char *p) {
  p = strdup(p);
  if (p == ((void *)0))
    fatal("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <xstrdup+0x32>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1030 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <xstrdup+0x1c>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
void printPID() {
  pid_t pid;
  if ((pid = getpid()) < 0)
    perror("ERROR WHILE GETTING PID!");
  printf("\nParent has PID %d", pid);
}


x86 assembly (clang, -O0):
<printPID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1157 <printPID+0x27>
lea    0xeae(%rip),%rdi
call   1050 <perror@plt>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPID>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
test   %eax,%eax
js     114d <printPID+0x1d>
lea    0xed4(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1050 <perror@plt>
jmp    113e <printPID+0xe>

LLVM IR (-O0):
@.str = [25 x i8] c"ERROR WHILE GETTING PID!\00"
@.str.1 = [19 x i8] c"\0AParent has PID %d\00"
define void @printPID() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
store i32 %2, i32* %1
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"ERROR WHILE GETTING PID!\00"
@.str.1 = [19 x i8] c"\0AParent has PID %d\00"
define void @printPID() {
%1 = tail call i32 (...) @getpid()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void block_free(void *vmem) { free(vmem); }


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

x86 assembly (clang, -O2):
<block_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @block_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int calc_nc(int c, int a) { return ((a & 0x7F) << 7) + (c & 0x7F); }


x86 assembly (clang, -O0):
<calc_nc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7f,%eax
shl    $0x7,%eax
mov    -0x4(%rbp),%ecx
and    $0x7f,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_nc>:
and    $0x7f,%esi
shl    $0x7,%esi
and    $0x7f,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @calc_nc(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 = and i32 %5, 127
%7 = shl i32 %6, 7
%8 = load i32, i32* %3
%9 = and i32 %8, 127
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @calc_nc(i32 %0, i32 %1) {
%3 = shl i32 %1, 7
%4 = and i32 %3, 16256
%5 = and i32 %0, 127
%6 = or i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_TLC;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
int asn1_item_ex_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                     int /*<<< orphan*/ const *, int, int, char,
                     int /*<<< orphan*/ *, int /*<<< orphan*/);
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
                     const ASN1_ITEM *it, int tag, int aclass, char opt,
                     ASN1_TLC *ctx) {
  return asn1_item_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0);
}


x86 assembly (clang, -O0):
<ASN1_item_ex_d2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    0x10(%rbp),%r10b
mov    0x18(%rbp),%rax
xor    %r11d,%r11d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <asn1_item_ex_d2i@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_item_ex_d2i>:
push   %rax
movsbl 0x10(%rsp),%eax
sub    $0x8,%rsp
push   $0x0
push   0x28(%rsp)
push   %rax
call   1030 <asn1_item_ex_d2i@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ASN1_item_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 %4, i32 %5, i8 signext %6, i32* %7) {
%9 = alloca i32**
%10 = alloca i8**
%11 = alloca i64
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8
%16 = alloca i32*
store i32** %0, i32*** %9
store i8** %1, i8*** %10
store i64 %2, i64* %11
store i32* %3, i32** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8 %6, i8* %15
store i32* %7, i32** %16
%17 = load i32**, i32*** %9
%18 = load i8**, i8*** %10
%19 = load i64, i64* %11
%20 = load i32*, i32** %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = load i8, i8* %15
%24 = load i32*, i32** %16
%25 = call i32 @asn1_item_ex_d2i(i32** %17, i8** %18, i64 %19, i32* %20, i32 %21, i32 %22, i8 signext %23, i32* %24, i32 0)
ret i32 %25
}

LLVM IR (-O2):
define i32 @ASN1_item_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 %4, i32 %5, i8 signext %6, i32* %7) {
%9 = tail call i32 @asn1_item_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 %4, i32 %5, i8 signext %6, i32* %7, i32 0)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_FLASH_CLK_PIN() { clear_io_bit(0x34, 3); }


x86 assembly (clang, -O0):
<TOSH_CLR_FLASH_CLK_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x3,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_FLASH_CLK_PIN>:
mov    $0x34,%edi
mov    $0x3,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_FLASH_CLK_PIN() {
%1 = call i32 @clear_io_bit(i32 52, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_FLASH_CLK_PIN() {
%1 = tail call i32 @clear_io_bit(i32 52, i32 3)
ret void
}
int compar_int(void *int1, void *int2) {
  int i1 = *((int *)int1), i2 = *((int *)int2);
  if (i1 > i2)
    return 1;
  else if (i2 > i1)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compar_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <compar_int+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <compar_int+0x55>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    114e <compar_int+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compar_int+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar_int>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %eax,%ecx
setg   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compar_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp sgt i32 %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void *send_to_nx() {}


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

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

LLVM IR (-O0):
define i8* @send_to_nx() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @send_to_nx() {
ret i8* undef
}
int test_imm_75int64_lowword_reg(long long val) {
  return ((val) & (0x75 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_75int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 117
%5 = icmp ne i64 %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_75int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 117
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_down();
int /*<<< orphan*/ test_flat();
int /*<<< orphan*/ test_left();
int /*<<< orphan*/ test_print_board();
int /*<<< orphan*/ test_right();
int /*<<< orphan*/ test_up();
int main(int argc, char **argv) {
  test_up();
  test_down();
  test_left();
  test_right();
  test_flat();
  test_print_board();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <test_up@plt>
mov    $0x0,%al
call   1080 <test_down@plt>
mov    $0x0,%al
call   1030 <test_left@plt>
mov    $0x0,%al
call   1050 <test_right@plt>
mov    $0x0,%al
call   1060 <test_flat@plt>
mov    $0x0,%al
call   1040 <test_print_board@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_up@plt>
xor    %eax,%eax
call   1080 <test_down@plt>
xor    %eax,%eax
call   1030 <test_left@plt>
xor    %eax,%eax
call   1050 <test_right@plt>
xor    %eax,%eax
call   1060 <test_flat@plt>
xor    %eax,%eax
call   1040 <test_print_board@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_up()
%7 = call i32 (...) @test_down()
%8 = call i32 (...) @test_left()
%9 = call i32 (...) @test_right()
%10 = call i32 (...) @test_flat()
%11 = call i32 (...) @test_print_board()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_up()
%4 = tail call i32 (...) @test_down()
%5 = tail call i32 (...) @test_left()
%6 = tail call i32 (...) @test_right()
%7 = tail call i32 (...) @test_flat()
%8 = tail call i32 (...) @test_print_board()
ret i32 0
}
int test_little_endian() {
  long cell = 1;
  return *(char *)&cell == 1;
}


x86 assembly (clang, -O0):
<test_little_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_little_endian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_little_endian() {
ret i32 1
}
void stop() {
  __asm__ __volatile__("cli");
  while (1) {
    halt();
  }
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0x0,%al
call   1030 <halt@plt>
jmp    1115 <stop+0x5>

x86 assembly (clang, -O2):
<stop>:
push   %rax
cli
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <halt@plt>
jmp    1120 <stop+0x10>

LLVM IR (-O0):
define void @stop() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @halt()
br label %1
}

LLVM IR (-O2):
define void @stop() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @halt()
br label %1
}
unsigned rgb_mask_make_from_def(unsigned len, unsigned pos) {
  return ((1 << len) - 1) << pos;
}


x86 assembly (clang, -O0):
<rgb_mask_make_from_def>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_mask_make_from_def>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rgb_mask_make_from_def(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 1, %5
%7 = sub nsw i32 %6, 1
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rgb_mask_make_from_def(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %0
%4 = xor i32 %3, -1
%5 = shl i32 %4, %1
ret i32 %5
}
int test_bit(int nr, unsigned long *addr) {
  return (((addr))[(nr) / (sizeof(unsigned long) * 8)] >>
          ((nr) % (sizeof(unsigned long) * 8))) &
         1;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 64
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load i64, i64* %9
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 64
%14 = lshr i64 %10, %13
%15 = and i64 %14, 1
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = lshr i64 %3, 6
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load i64, i64* %5
%7 = and i64 %3, 63
%8 = lshr i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
double sun_equation_of_centre(double);
double sun_geometric_mean_longitude(double);
double sun_real_longitude(double tm) {
  return sun_geometric_mean_longitude(tm) + sun_equation_of_centre(tm);
}


x86 assembly (clang, -O0):
<sun_real_longitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sun_geometric_mean_longitude@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sun_equation_of_centre@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_real_longitude>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <sun_geometric_mean_longitude@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sun_equation_of_centre@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sun_real_longitude(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sun_geometric_mean_longitude(double %3)
%5 = load double, double* %2
%6 = call double @sun_equation_of_centre(double %5)
%7 = fadd double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @sun_real_longitude(double %0) {
%2 = tail call double @sun_geometric_mean_longitude(double %0)
%3 = tail call double @sun_equation_of_centre(double %0)
%4 = fadd double %2, %3
ret double %4
}
int isatty(int fildes) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 0
}
/* Variables and functions */
int c(int);
int b(int n) {
  if (n > 10) {
    return n;
  } else {
    return c(n + 1);
  }
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    1130 <b+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <b+0x2e>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
cmp    $0xa,%edi
jle    1118 <b+0x8>
mov    %edi,%eax
ret
add    $0x1,%edi
jmp    1030 <c@plt>

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

LLVM IR (-O2):
define i32 @b(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, 1
%5 = tail call i32 @c(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ strcmp(char *, char *);
int main(void) {
  assert(strcmp("'\"' + \"' \\\"\"", "'\"' + \"' \\\"\"") == 0);
  assert(strcmp("\"abc\"", "\"abc\"") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb7(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xec8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"'\22' + \22' \\\22\22\00"
@.str.1 = [6 x i8] c"\22abc\22\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @strcmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"'\22' + \22' \\\22\22\00"
@.str.1 = [6 x i8] c"\22abc\22\00"
define i32 @main() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_41(uint64_t x) {
  __asm__("rolq $41, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_41>:
mov    %rdi,%rax
rol    $0x29,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_41(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$41, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_41(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$41, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
double sqrt(double);
double len(double *x) { return sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); }


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <len+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @len(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @len(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Variables and functions */
float df1x(float, float);
float df1y(float, float);
float df2x(float, float);
float df2y(float, float);
float jacobian(float x, float y) {
  return (df1x(x, y) * df2y(x, y) - df1y(x, y) * df2x(x, y));
}


x86 assembly (clang, -O0):
<jacobian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <df1x@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <df2y@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1060 <df1y@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1050 <df2x@plt>
movss  -0x14(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0xc(%rbp),%xmm0
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jacobian>:
sub    $0x18,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
call   1040 <df1x@plt>
movss  %xmm0,0x14(%rsp)
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <df2y@plt>
movss  %xmm0,0x10(%rsp)
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1060 <df1y@plt>
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1050 <df2x@plt>
mulss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
mulss  0x14(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @jacobian(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @df1x(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call float @df2y(float %8, float %9)
%11 = load float, float* %3
%12 = load float, float* %4
%13 = call float @df1y(float %11, float %12)
%14 = load float, float* %3
%15 = load float, float* %4
%16 = call float @df2x(float %14, float %15)
%17 = fmul float %13, %16
%18 = fneg float %17
%19 = call float @llvm.fmuladd.f32(float %7, float %10, float %18)
ret float %19
}

LLVM IR (-O2):
define float @jacobian(float %0, float %1) {
%3 = tail call float @df1x(float %0, float %1)
%4 = tail call float @df2y(float %0, float %1)
%5 = tail call float @df1y(float %0, float %1)
%6 = tail call float @df2x(float %0, float %1)
%7 = fneg float %5
%8 = fmul float %6, %7
%9 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %8)
ret float %9
}
int example_dll_gen_function(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @example_dll_gen_function() {
ret i32 0
}
/* Variables and functions */
int *get_init_memory_heap(int);
int *get_init_memory_stack(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *ps = get_init_memory_stack(20);
  int *ph = get_init_memory_heap(20);
  printf("ph[5] = %d\n", ph[5]);
  printf("ps[5] = %d\n", ps[5]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1030 <get_init_memory_stack@plt>
mov    %rax,-0x8(%rbp)
mov    $0x14,%edi
call   1050 <get_init_memory_heap@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1030 <get_init_memory_stack@plt>
mov    %rax,%rbx
mov    $0x14,%edi
call   1050 <get_init_memory_heap@plt>
mov    0x14(%rax),%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    0x14(%rbx),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"ph[5] = %d\0A\00"
@.str.1 = [12 x i8] c"ps[5] = %d\0A\00"
define i32 @main() {
%1 = tail call i32* @get_init_memory_stack(i32 20)
%2 = tail call i32* @get_init_memory_heap(i32 20)
%3 = getelementptr inbounds i32, i32* %2, i64 5
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds i32, i32* %1, i64 5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int RLFL_randint(int);
int RLFL_randrange(int min, int max) {
  return RLFL_randint(min + 1 + (max - min));
}


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

x86 assembly (clang, -O2):
<RLFL_randrange>:
lea    0x1(%rsi),%edi
jmp    1030 <RLFL_randint@plt>

LLVM IR (-O0):
define i32 @RLFL_randrange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %6, %9
%11 = call i32 @RLFL_randint(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @RLFL_randrange(i32 %0, i32 %1) {
%3 = add i32 %1, 1
%4 = tail call i32 @RLFL_randint(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, unsigned char *, int);
int get_iv_len(unsigned char *algo_id) {
  if (!memcmp("\x00\x12", algo_id, 2))
    return 16;
}


x86 assembly (clang, -O0):
<get_iv_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x2,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    1141 <get_iv_len+0x31>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_iv_len>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
mov    $0x2,%edx
call   1030 <memcmp@plt>
mov    $0x10,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\00\12\00"
define i32 @get_iv_len(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @memcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4, i32 2)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 16, i32* %2
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"\00\12\00"
define i32 @get_iv_len(i8* %0) {
%2 = tail call i32 @memcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32 2)
ret i32 16
}
/* Variables and functions */
int /*<<< orphan*/ test_lifecycle();
int main(int argc, char **argv) {
  test_lifecycle();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_lifecycle()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glmASin3f(float *, float *);
void glmASin3f_(float x[3]) { glmASin3f(x, x); }


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

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

LLVM IR (-O0):
define void @glmASin3f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @glmASin3f(float* %3, float* %4)
ret void
}

LLVM IR (-O2):
define void @glmASin3f_(float* %0) {
%2 = tail call i32 @glmASin3f(float* %0, float* %0)
ret void
}
int test_imm_7Buint8_reg(unsigned char val) {
  return ((val) & (-0x7B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff85,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -123
%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_7Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -123
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void masterTermHandler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @masterTermHandler(i32 %0) {
ret void
}
void ti81xxfb_reserve_sdram_memblock(void) {}


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

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

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

LLVM IR (-O2):
define void @ti81xxfb_reserve_sdram_memblock() {
ret void
}
int input_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @input_init() {
ret i32 0
}
int isinf(double x) { return __builtin_isinf(x); }


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xefb(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xedf(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
andpd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xefe(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fcmp oeq double %4, 0x7FF0000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp oeq double %2, 0x7FF0000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}
int moose_function_if() {}


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

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

LLVM IR (-O0):
define i32 @moose_function_if() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @moose_function_if() {
ret i32 undef
}
/* Variables and functions */
float pow(double, double);
int main(void) {
  float x = pow(10.0, 39.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  0xed9(%rip),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float @pow(double 1.000000e+01, double 3.900000e+01)
store float %3, float* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @pow(double 1.000000e+01, double 3.900000e+01)
ret i32 0
}
int fn2(int x) { return x | ~x; }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn2(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int socketcall(int (*)(int, int, int, int *), int, int, int, int *,
               int /*<<< orphan*/, int /*<<< orphan*/);
int socketpair(int domain, int type, int protocol, int fd[2]) {
  return socketcall(socketpair, domain, type, protocol, fd, 0, 0);
}


x86 assembly (clang, -O0):
<socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    0x2eaf(%rip),%rdi
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketpair>:
push   %rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2ec0(%rip),%rdi
xor    %r9d,%r9d
call   1030 <socketcall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @socketcall(i32 (i32, i32, i32, i32*)* @socketpair, i32 %0, i32 %1, i32 %2, i32* %3, i32 0, i32 0)
ret i32 %5
}