xunge/DecIR huggingface dataset:
int same(const char *a, const char *b, int len) {
  while (len-- > 0) {
    if (*a++ != *b++)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<same>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1160 <same+0x60>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115b <same+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1167 <same+0x67>
jmp    110f <same+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<same>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %edx,%edx
jle    112c <same+0x2c>
add    $0xffffffff,%edx
movzbl (%rdi,%rax,1),%r8d
lea    0x1(%rax),%rcx
cmp    (%rsi,%rax,1),%r8b
mov    %rcx,%rax
je     1110 <same+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @same(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
/* Variables and functions */
char *getenv(char *);
int ms_readleapsecondfile(char *);
int ms_readleapseconds(char *envvarname) {
  char *filename;
  if ((filename = getenv(envvarname))) {
    return ms_readleapsecondfile(filename);
  }
  return -2;
}


x86 assembly (clang, -O0):
<ms_readleapseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1154 <ms_readleapseconds+0x34>
mov    -0x18(%rbp),%rdi
call   1040 <ms_readleapsecondfile@plt>
mov    %eax,-0x4(%rbp)
jmp    115b <ms_readleapseconds+0x3b>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_readleapseconds>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1134 <ms_readleapseconds+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <ms_readleapsecondfile@plt>
mov    $0xfffffffe,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ms_readleapseconds(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @ms_readleapsecondfile(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -2, %1 ]
ret i32 %7
}
/* Type definitions */
struct archive {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct archive *);
void archive_free(struct archive *ar) { free(ar); }


x86 assembly (clang, -O0):
<archive_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):
<archive_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.archive = type { i32 }
define void @archive_free(%struct.archive* nocapture %0) {
%2 = tail call i32 @free(%struct.archive* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() { printf("Coming soon...\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Coming soon...\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Coming soon...\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 3662329353U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    114f <RandomFunc+0x4f>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
add    -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
sub    $0xda4ab609,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
add    %eax,%eax
add    $0x24816081,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %16, %2
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = add i32 %24, %20
store i32 %25, i32* %23
%26 = load i32, i32* %6
%27 = zext i32 %26 to i64
%28 = add i64 %27, 2
%29 = trunc i64 %28 to i32
store i32 %29, i32* %6
br label %12
30: ; preds = %12
%31 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%32 = load i32, i32* %31
%33 = sub i32 %32, -632637943
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 0
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 1
%5 = add i32 %4, 612458625
store i32 %5, i32* %1
ret void
}
char *XrmLocaleOfDatabase() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XrmLocaleOfDatabase() {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
size_t read_FD(int, int /*<<< orphan*/ *, int);
size_t int8ReadFromFD(int fd, int8_t *data) {
  return read_FD(fd, data, sizeof(int8_t));
}


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

x86 assembly (clang, -O2):
<int8ReadFromFD>:
mov    $0x4,%edx
jmp    1030 <read_FD@plt>

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

LLVM IR (-O2):
define i64 @int8ReadFromFD(i32 %0, i32* %1) {
%3 = tail call i64 @read_FD(i32 %0, i32* %1, i32 4)
ret i64 %3
}
double max(double x1, double x2) { return (x1 > x2 ? x1 : x2); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int test_imm_3Fint8_reg(signed char val) {
  return ((val) & (-0x3F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -63
%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_3Fint8_reg(i8 signext %0) {
%2 = and i8 %0, -63
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _SC_AVPHYS_PAGES;
long sysconf(int /*<<< orphan*/);
long avail_mem_pages(void) { return sysconf(_SC_AVPHYS_PAGES); }


x86 assembly (clang, -O0):
<avail_mem_pages>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<avail_mem_pages>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_AVPHYS_PAGES = global i32 0
define i64 @avail_mem_pages() {
%1 = load i32, i32* @_SC_AVPHYS_PAGES
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_AVPHYS_PAGES = global i32 0
define i64 @avail_mem_pages() {
%1 = load i32, i32* @_SC_AVPHYS_PAGES
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
int main() {
  if (!0) {
    return 3;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
int test_imm_2Fint64_highword_reg(long long val) {
  return ((val >> 32) & (0x2F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Fint64_highword_reg>:
movabs $0x2f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Fint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 47
%6 = icmp ne i64 %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_2Fint64_highword_reg(i64 %0) {
%2 = and i64 %0, 201863462912
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int voidcaller(void (*pfn)(void)) {
  pfn();
  return 2;
}


x86 assembly (clang, -O0):
<voidcaller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voidcaller>:
push   %rax
call   *%rdi
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @voidcaller(void ()* nocapture %0) {
tail call void %0()
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ early_puts(char *);
unsigned long _sclp_param(unsigned long long *dst) {
  early_puts("_sclp_param\n");
  *dst = 1;
  return 0;
}


x86 assembly (clang, -O0):
<_sclp_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <early_puts@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sclp_param>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <early_puts@plt>
movq   $0x1,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"_sclp_param\0A\00"
define i64 @_sclp_param(i64* nocapture writeonly %0) {
%2 = tail call i32 @early_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i64 1, i64* %0
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
char *lrtr_malloc(size_t);
char *memcpy(char *, char const *, size_t);
int strlen(char const *);
char *lrtr_strdup(const char *string) {
  assert(string);
  size_t length = strlen(string) + 1;
  char *new_string = lrtr_malloc(length);
  return new_string ? memcpy(new_string, string, length) : NULL;
}


x86 assembly (clang, -O0):
<lrtr_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <lrtr_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1199 <lrtr_strdup+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <memcpy@plt>
mov    %rax,-0x20(%rbp)
jmp    11a4 <lrtr_strdup+0x64>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    11a4 <lrtr_strdup+0x64>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrtr_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1050 <assert@plt>
mov    %r15,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r14
mov    %r14,%rdi
call   1040 <lrtr_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1179 <lrtr_strdup+0x39>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1060 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @lrtr_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = call i8* @lrtr_malloc(i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %20
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = load i64, i64* %3
%19 = call i8* @memcpy(i8* %16, i8* %17, i64 %18)
br label %21
20: ; preds = %1
br label %21
21: ; preds = %20, %15
%22 = phi i8* [ %19, %15 ], [ null, %20 ]
ret i8* %22
}

LLVM IR (-O2):
define i8* @lrtr_strdup(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = tail call i8* @lrtr_malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %0, i64 %5, i1 false)
br label %9
9: ; preds = %1, %8
ret i8* %6
}
/* Variables and functions */
double POP();
int /*<<< orphan*/ PUSH(double);
void sub(void) {
  double x;
  x = POP();
  PUSH(POP() - x);
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <POP@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <POP@plt>
subsd  -0x8(%rbp),%xmm0
call   1040 <PUSH@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rax
xor    %eax,%eax
call   1030 <POP@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <POP@plt>
subsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <PUSH@plt>

LLVM IR (-O0):
define void @sub() {
%1 = alloca double
%2 = call double (...) @POP()
store double %2, double* %1
%3 = call double (...) @POP()
%4 = load double, double* %1
%5 = fsub double %3, %4
%6 = call i32 @PUSH(double %5)
ret void
}

LLVM IR (-O2):
define void @sub() {
%1 = tail call double (...) @POP()
%2 = tail call double (...) @POP()
%3 = fsub double %2, %1
%4 = tail call i32 @PUSH(double %3)
ret void
}
int okn_tsm_pos(struct okn_tsm *t, struct okn_vec3f *v) { return 1; }


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

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

LLVM IR (-O0):
%struct.okn_tsm = type opaque
%struct.okn_vec3f = type opaque
define i32 @okn_tsm_pos(%struct.okn_tsm* %0, %struct.okn_vec3f* %1) {
%3 = alloca %struct.okn_tsm*
%4 = alloca %struct.okn_vec3f*
store %struct.okn_tsm* %0, %struct.okn_tsm** %3
store %struct.okn_vec3f* %1, %struct.okn_vec3f** %4
ret i32 1
}

LLVM IR (-O2):
%struct.okn_tsm = type opaque
%struct.okn_vec3f = type opaque
define i32 @okn_tsm_pos(%struct.okn_tsm* nocapture readnone %0, %struct.okn_vec3f* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *strdup(char *);
void http_table_column_add_int(char **buff, int val) {
  char tmp[100];
  sprintf(tmp, "%d", val);
  *buff = strdup(tmp);
}


x86 assembly (clang, -O0):
<http_table_column_add_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_table_column_add_int>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <sprintf@plt>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @http_table_column_add_int(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca [100 x i8]
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = call i8* @strdup(i8* %9)
%11 = load i8**, i8*** %3
store i8* %10, i8** %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @http_table_column_add_int(i8** nocapture writeonly %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i8* @strdup(i8* %4)
store i8* %6, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ r;

/* Variables and functions */
int /*<<< orphan*/ rc4(unsigned char *, int);
uint32_t rc4rand(void) {
  uint32_t r;
  rc4((unsigned char *)&r, sizeof(r));
  return r;
}


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

x86 assembly (clang, -O2):
<rc4rand>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <rc4@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rc4rand() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @rc4(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @rc4rand() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @rc4(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int argOneNotNull(int *, int *);
void f(int *p1, int *p2) {
  int x;
  for (;;) {
    if (p1 && argOneNotNull(p1, &x) > 10)
      return;
    p1 = p2;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <f+0x37>
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <argOneNotNull@plt>
cmp    $0xa,%eax
jle    1147 <f+0x37>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <f+0x10>

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0x4(%rsp),%r14
nopl   0x0(%rax)
mov    %rdi,%rax
mov    %rbx,%rdi
test   %rax,%rax
je     1120 <f+0x10>
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <argOneNotNull@plt>
mov    %rbx,%rdi
cmp    $0xb,%eax
jl     1120 <f+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @f(i32* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %11, %2
%6 = phi i32* [ %0, %2 ], [ %1, %11 ]
%7 = icmp eq i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = call i32 @argOneNotNull(i32* %6, i32* %3)
%10 = icmp sgt i32 %9, 10
br i1 %10, label %12, label %11
11: ; preds = %8, %5
br label %5
12: ; preds = %8
ret void
}
int main() {
  int x;
  int *p;
  x = 0;
  p = &x;
  return p[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fun656() { return 656; }


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

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

LLVM IR (-O0):
define i32 @fun656() {
ret i32 656
}

LLVM IR (-O2):
define i32 @fun656() {
ret i32 656
}
__attribute__((vector_size(16))) float f1(void) {
  __attribute__((vector_size(16))) float vec = {0.0f, 0.0f, 0.0f};
  return (vec);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <4 x float> @f1() {
%1 = alloca <4 x float>
store <4 x float> zeroinitializer, <4 x float>* %1
%2 = load <4 x float>, <4 x float>* %1
ret <4 x float> %2
}

LLVM IR (-O2):
define <4 x float> @f1() {
ret <4 x float> zeroinitializer
}
/* Variables and functions */
int /*<<< orphan*/ app();
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello world!");
  app();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <app@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <app@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @app()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @app()
ret i32 0
}
unsigned ClearLowestBit(unsigned x) { return x & (x - 1); }


x86 assembly (clang, -O0):
<ClearLowestBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearLowestBit>:
lea    -0x1(%rdi),%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ClearLowestBit(i32 %0) {
%2 = add i32 %0, -1
%3 = and i32 %2, %0
ret i32 %3
}
void create_drive_straight(int speed) {}


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

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

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

LLVM IR (-O2):
define void @create_drive_straight(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void callLqp(char *str) { printf("string from go: %s\n", str); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"string from go: %s\0A\00"
define void @callLqp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"string from go: %s\0A\00"
define void @callLqp(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
long double lgammal(long double __d) {
  signed int __local_signgam = 0;
  long double return_value_lgammal_r$1;
  return_value_lgammal_r$1 = lgammal_r(__d, &__local_signgam);
  return return_value_lgammal_r$1;
}


x86 assembly (clang, -O0):
<lgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movl   $0x0,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
xor    %eax,%eax
lea    -0x14(%rbp),%rdi
call   1030 <lgammal_r@plt>
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgammal>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
movl   $0x0,0x14(%rsp)
fstpt  (%rsp)
lea    0x14(%rsp),%rdi
xor    %eax,%eax
call   1030 <lgammal_r@plt>
mov    %eax,0x10(%rsp)
fildl  0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @lgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store i32 0, i32* %3
%5 = load x86_fp80, x86_fp80* %2
%6 = call i32 (x86_fp80, i32*, ...) bitcast (i32 (...)* @lgammal_r to i32 (x86_fp80, i32*, ...)*)(x86_fp80 %5, i32* %3)
%7 = sitofp i32 %6 to x86_fp80
store x86_fp80 %7, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @lgammal(x86_fp80 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 (x86_fp80, i32*, ...) bitcast (i32 (...)* @lgammal_r to i32 (x86_fp80, i32*, ...)*)(x86_fp80 %0, i32* %2)
%5 = sitofp i32 %4 to x86_fp80
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Mutatee: Main\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Mutatee: Main\0A\00"
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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Mutatee: Main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int waitpid(int, int *, int /*<<< orphan*/);
int _waitpid(pid_t pid) {
  int status;
  pid_t r;
  r = waitpid(pid, &status, 0);
  if (r > -1)
    return 0;
  else
    perror("waitpid");
  return r;
}


x86 assembly (clang, -O0):
<_waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1030 <waitpid@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jle    1152 <_waitpid+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1164 <_waitpid+0x44>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_waitpid>:
push   %rbp
push   %rbx
push   %rax
lea    0x4(%rsp),%rsi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <waitpid@plt>
test   %eax,%eax
js     113e <_waitpid+0x1e>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %eax,%ebp
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    %ebp,%ebx
jmp    1135 <_waitpid+0x15>

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

LLVM IR (-O2):
@.str = [8 x i8] c"waitpid\00"
define i32 @_waitpid(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @waitpid(i32 %0, i32* %2, i32 0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %4, %6 ], [ 0, %1 ]
ret i32 %9
}
void __hv_var_k_f(float *bOut, const float k) { *bOut = k; }


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

x86 assembly (clang, -O2):
<__hv_var_k_f>:
movss  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @__hv_var_k_f(float* nocapture writeonly %0, float %1) {
store float %1, float* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("sudo yum install dd ddrescue pv");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"sudo yum install dd ddrescue pv\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"sudo yum install dd ddrescue pv\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double Absff_Atod(s)
char *s;
{
  double d;
  if (sscanf(s, "%lf", &d) > 0)
    return d;
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<Absff_Atod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
cmp    $0x0,%eax
jle    114a <Absff_Atod+0x3a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1152 <Absff_Atod+0x42>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Absff_Atod>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <sscanf@plt>
test   %eax,%eax
jg     112b <Absff_Atod+0x1b>
xorps  %xmm0,%xmm0
pop    %rax
ret
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define double @Absff_Atod(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 (i8*, i8*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load double, double* %4
store double %9, double* %2
br label %11
10: ; preds = %1
store double 0.000000e+00, double* %2
br label %11
11: ; preds = %10, %8
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define double @Absff_Atod(i8* nocapture %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = icmp sgt i32 %4, 0
%6 = load double, double* %2
%7 = select i1 %5, double %6, double 0.000000e+00
ret double %7
}
/* Type definitions */
struct winsize {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
struct winsize get_window_size() {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w;
}


x86 assembly (clang, -O0):
<get_window_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_window_size>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_window_size() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_window_size() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *);
void window_draw_string(int x, int y, char *value) { mvprintw(y, x, value); }


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

x86 assembly (clang, -O2):
<window_draw_string>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <mvprintw@plt>

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

LLVM IR (-O2):
define void @window_draw_string(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @mvprintw(i32 %1, i32 %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *my_strcat(char *dest, const char *src) {
  strcpy(dest + strlen(dest), src);
  return dest;
}


x86 assembly (clang, -O0):
<my_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @my_strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
double rom__muldf3(double, double);
double __muldf3(double a, double b) { return rom__muldf3(a, b); }


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

x86 assembly (clang, -O2):
<__muldf3>:
jmp    1030 <rom__muldf3@plt>

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

LLVM IR (-O2):
define double @__muldf3(double %0, double %1) {
%3 = tail call double @rom__muldf3(double %0, double %1)
ret double %3
}
int linear_search(int *a, int n, int key) {
  int i;
  for (i = 0; i < n && a[i] != key; ++i)
    ;
  return (i < n) ? i : -1;
}


x86 assembly (clang, -O0):
<linear_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x15(%rbp)
jge    113a <linear_search+0x3a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114a <linear_search+0x4a>
jmp    115d <linear_search+0x5d>
jmp    114f <linear_search+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <linear_search+0x15>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1174 <linear_search+0x74>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1181 <linear_search+0x81>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1181 <linear_search+0x81>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linear_search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linear_search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linear_search+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @linear_search(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = icmp ne i32 %17, %18
br label %20
20: ; preds = %12, %8
%21 = phi i1 [ false, %8 ], [ %19, %12 ]
br i1 %21, label %22, label %26
22: ; preds = %20
br label %23
23: ; preds = %22
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %8
26: ; preds = %20
%27 = load i32, i32* %7
%28 = load i32, i32* %5
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load i32, i32* %7
br label %33
32: ; preds = %26
br label %33
33: ; preds = %32, %30
%34 = phi i32 [ %31, %30 ], [ -1, %32 ]
ret i32 %34
}

LLVM IR (-O2):
define i32 @linear_search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int test_imm_73uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x73 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_73uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 115
%7 = icmp ne i64 %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_73uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7536640
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_md5;
int jksengine_digests_update(int /*<<< orphan*/ *, void const *, unsigned long,
                             int /*<<< orphan*/);
int jksengine_md5_update(EVP_MD_CTX *ctx, const void *data,
                         unsigned long count) {
  ;
  return (jksengine_digests_update(ctx, data, count, NID_md5));
}


x86 assembly (clang, -O0):
<jksengine_md5_update>:
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
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
call   1030 <jksengine_digests_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_md5_update>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <jksengine_digests_update@plt>

LLVM IR (-O0):
@NID_md5 = global i32 0
define i32 @jksengine_md5_update(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 = load i32, i32* @NID_md5
%11 = call i32 @jksengine_digests_update(i32* %7, i8* %8, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@NID_md5 = global i32 0
define i32 @jksengine_md5_update(i32* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @NID_md5
%5 = tail call i32 @jksengine_digests_update(i32* %0, i8* %1, i64 %2, i32 %4)
ret i32 %5
}