xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ push(char *);
void push_t() { push(L"t"); }


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

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

LLVM IR (-O0):
@.str = [2 x i32] [i32 116, i32 0]
define void @push_t() {
%1 = call i32 @push(i8* bitcast ([2 x i32]* @.str to i8*))
ret void
}

LLVM IR (-O2):
@.str = [2 x i32] [i32 116, i32 0]
define void @push_t() {
%1 = tail call i32 @push(i8* bitcast ([2 x i32]* @.str to i8*))
ret void
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __updwtmp(char const *, struct utmp *);
scalar_t__ __utmpx_to_utmp(struct utmpx const *, struct utmp *);
void updwtmpx(const char *wtmpx_file, const struct utmpx *utmpx) {
  struct utmp tmp;
  if (__utmpx_to_utmp(utmpx, &tmp) >= 0)
    __updwtmp(wtmpx_file, &tmp);
}


x86 assembly (clang, -O0):
<updwtmpx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <__utmpx_to_utmp@plt>
cmp    $0x0,%rax
jl     1154 <updwtmpx+0x34>
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <__updwtmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updwtmpx>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1030 <__utmpx_to_utmp@plt>
test   %rax,%rax
js     114a <updwtmpx+0x2a>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <__updwtmp@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @updwtmpx(i8* %0, %struct.utmpx* %1) {
%3 = alloca i8*
%4 = alloca %struct.utmpx*
%5 = alloca %struct.utmp
store i8* %0, i8** %3
store %struct.utmpx* %1, %struct.utmpx** %4
%6 = load %struct.utmpx*, %struct.utmpx** %4
%7 = call i64 @__utmpx_to_utmp(%struct.utmpx* %6, %struct.utmp* %5)
%8 = icmp sge i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @__updwtmp(i8* %10, %struct.utmp* %5)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @updwtmpx(i8* %0, %struct.utmpx* %1) {
%3 = alloca %struct.utmp
%4 = bitcast %struct.utmp* %3 to i8*
%5 = call i64 @__utmpx_to_utmp(%struct.utmpx* %1, %struct.utmp* %3)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @__updwtmp(i8* %0, %struct.utmp* %3)
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int show_foo();
void show_xyzzy() { printf("%d", show_foo()); }


x86 assembly (clang, -O0):
<show_xyzzy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <show_foo@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_xyzzy>:
push   %rax
xor    %eax,%eax
call   1040 <show_foo@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @show_xyzzy() {
%1 = call i32 (...) @show_foo()
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @show_xyzzy() {
%1 = tail call i32 (...) @show_foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void g_object_weak_ref() {}


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

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

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

LLVM IR (-O2):
define void @g_object_weak_ref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlEnter(char *);
int /*<<< orphan*/ xlThrowError(int /*<<< orphan*/);
void xlTopLevel(void) { xlThrowError(xlEnter("RESET")); }


x86 assembly (clang, -O0):
<xlTopLevel>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <xlEnter@plt>
mov    %eax,%edi
call   1030 <xlThrowError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlTopLevel>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <xlEnter@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <xlThrowError@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"RESET\00"
define void @xlTopLevel() {
%1 = call i32 @xlEnter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @xlThrowError(i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"RESET\00"
define void @xlTopLevel() {
%1 = tail call i32 @xlEnter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @xlThrowError(i32 %1)
ret void
}
void gtk_widget_set_app_paintable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_set_app_paintable() {
ret void
}
/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  unsigned int x = 0xF;
  int val = bitcount(x);
  printf("val = %d\n", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <bitcount@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
call   1040 <bitcount@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"val = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @bitcount(i32 15)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long long, char const *);
int /*<<< orphan*/ stderr;
void parse_error(long long n_lines, const char *__restrict msg) {
  fprintf(stderr, "Parse error at line %lld: %s\n", (long long)n_lines, msg);
  abort();
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<parse_error>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Parse error at line %lld: %s\0A\00"
define void @parse_error(i64 %0, i8* noalias %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i64, i64* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7)
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Parse error at line %lld: %s\0A\00"
define void @parse_error(i64 %0, i8* noalias %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %1)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ppuSetNameTblSingleLower();
int /*<<< orphan*/ ppuSetNameTblSingleUpper();
void m154setParamsMirror(uint16_t addr, uint8_t val) {
  (void)addr;
  if ((val & 0x40) == 0)
    ppuSetNameTblSingleLower();
  else
    ppuSetNameTblSingleUpper();
}


x86 assembly (clang, -O0):
<m154setParamsMirror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    1149 <m154setParamsMirror+0x29>
mov    $0x0,%al
call   1040 <ppuSetNameTblSingleLower@plt>
jmp    1150 <m154setParamsMirror+0x30>
mov    $0x0,%al
call   1030 <ppuSetNameTblSingleUpper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m154setParamsMirror>:
xor    %eax,%eax
test   $0x40,%sil
jne    112d <m154setParamsMirror+0xd>
jmp    1040 <ppuSetNameTblSingleLower@plt>
jmp    1030 <ppuSetNameTblSingleUpper@plt>

LLVM IR (-O0):
define void @m154setParamsMirror(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 = and i32 %6, 64
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @ppuSetNameTblSingleLower()
br label %13
11: ; preds = %2
%12 = call i32 (...) @ppuSetNameTblSingleUpper()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @m154setParamsMirror(i32 %0, i32 %1) {
%3 = and i32 %1, 64
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @ppuSetNameTblSingleLower()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ppuSetNameTblSingleUpper()
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int atoi(char *);
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int read(int, char *, int);
int sysfs_get_value(char *fname) {
  char buf[64];
  int fd = open(fname, O_RDONLY);
  int sz = read(fd, buf, sizeof(buf) - 1);
  buf[sz] = 0;
  close(fd);
  return atoi(buf);
}


x86 assembly (clang, -O0):
<sysfs_get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x3f,%edx
call   1040 <read@plt>
mov    %eax,-0x58(%rbp)
movslq -0x58(%rbp),%rax
movb   $0x0,-0x50(%rbp,%rax,1)
mov    -0x54(%rbp),%edi
call   1030 <close@plt>
lea    -0x50(%rbp),%rdi
call   1060 <atoi@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_get_value>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %eax,%edi
mov    %r14,%rsi
mov    $0x3f,%edx
call   1040 <read@plt>
cltq
movb   $0x0,(%rsp,%rax,1)
mov    %ebx,%edi
call   1030 <close@plt>
mov    %r14,%rdi
call   1060 <atoi@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @sysfs_get_value(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%11 = call i32 @read(i32 %9, i8* %10, i32 63)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 %13
store i8 0, i8* %14
%15 = load i32, i32* %4
%16 = call i32 @close(i32 %15)
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%18 = call i32 @atoi(i8* %17)
ret i32 %18
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @sysfs_get_value(i8* nocapture %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = call i32 @read(i32 %5, i8* %3, i32 63)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %7
store i8 0, i8* %8
%9 = tail call i32 @close(i32 %5)
%10 = call i32 @atoi(i8* %3)
ret i32 %10
}
/* Variables and functions */
int memcmp(char const *, char const *, int);
int strlen(char const *);
int strrcmp(const char *s, const char *sub) {
  int slen = strlen(s);
  int sublen = strlen(sub);
  return memcmp(s + slen - sublen, sub, sublen);
}


x86 assembly (clang, -O0):
<strrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
movslq -0x18(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <memcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrcmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %ebp,%rdi
add    %rbx,%rdi
movslq %eax,%rdx
sub    %rdx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <memcmp@plt>

LLVM IR (-O0):
define i32 @strrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = sub i64 0, %16
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8*, i8** %4
%20 = load i32, i32* %6
%21 = call i32 @memcmp(i8* %18, i8* %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @strrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = sext i32 %4 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = tail call i32 @memcmp(i8* %9, i8* %1, i32 %4)
ret i32 %10
}
/* Variables and functions */
double *malloc(int);
int /*<<< orphan*/ memcpy(double *, double *, int);
double *doubles_copy(double *v, int len) {
  if (!v)
    return NULL;
  double *r = malloc(len * sizeof(double));
  memcpy(r, v, len * sizeof(double));
  return r;
}


x86 assembly (clang, -O0):
<doubles_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <doubles_copy+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1179 <doubles_copy+0x59>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_copy>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     114b <doubles_copy+0x2b>
mov    %esi,%ebx
mov    %rdi,%r15
shl    $0x3,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
jmp    114e <doubles_copy+0x2e>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double* @doubles_copy(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
%6 = alloca double*
store double* %0, double** %4
store i32 %1, i32* %5
%7 = load double*, double** %4
%8 = icmp ne double* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store double* null, double** %3
br label %24
10: ; preds = %2
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 8
%14 = trunc i64 %13 to i32
%15 = call double* @malloc(i32 %14)
store double* %15, double** %6
%16 = load double*, double** %6
%17 = load double*, double** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 8
%21 = trunc i64 %20 to i32
%22 = call i32 @memcpy(double* %16, double* %17, i32 %21)
%23 = load double*, double** %6
store double* %23, double** %3
br label %24
24: ; preds = %10, %9
%25 = load double*, double** %3
ret double* %25
}

LLVM IR (-O2):
define double* @doubles_copy(double* %0, i32 %1) {
%3 = icmp eq double* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = shl i32 %1, 3
%6 = tail call double* @malloc(i32 %5)
%7 = tail call i32 @memcpy(double* %6, double* %0, i32 %5)
br label %8
8: ; preds = %2, %4
%9 = phi double* [ %6, %4 ], [ null, %2 ]
ret double* %9
}
_Bool __atomic_compare_exchange_1(volatile void *atom, void *ref,
                                  unsigned char xchg, _Bool weak,
                                  int success_memorder, int failure_memorder) {
  unsigned char rv;
  unsigned char cmp = *(unsigned char *)ref;
  asm volatile("lock cmpxchg"
               "b"
               " %2,%1\n"
               : "=a"(rv), "+m"(*(unsigned char *)atom)
               : "q"(xchg), "0"(cmp)
               : "memory");
  *(unsigned char *)ref = rv;
  return (rv == cmp);
}


x86 assembly (clang, -O0):
<__atomic_compare_exchange_1>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
and    $0x1,%al
mov    %al,-0x12(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1e(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x11(%rbp),%dl
mov    -0x1e(%rbp),%al
lock cmpxchg %dl,(%rcx)
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x1d(%rbp),%eax
movzbl -0x1e(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_compare_exchange_1>:
mov    (%rsi),%cl
mov    %ecx,%eax
lock cmpxchg %dl,(%rdi)
mov    %al,(%rsi)
cmp    %cl,%al
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @__atomic_compare_exchange_1(i8* %0, i8* %1, i8 zeroext %2, i1 zeroext %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8
%14 = alloca i8
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8 %2, i8* %9
%15 = zext i1 %3 to i8
store i8 %15, i8* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i8*, i8** %8
%17 = load i8, i8* %16
store i8 %17, i8* %14
%18 = load i8*, i8** %7
%19 = load i8, i8* %9
%20 = load i8, i8* %14
%21 = call i8 asm sideeffect "lock cmpxchgb $2,$1\0A", "={ax},=*m,q,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %18, i8 %19, i8 %20, i8* elementtype(i8) %18)
store i8 %21, i8* %13
%22 = load i8, i8* %13
%23 = load i8*, i8** %8
store i8 %22, i8* %23
%24 = load i8, i8* %13
%25 = zext i8 %24 to i32
%26 = load i8, i8* %14
%27 = zext i8 %26 to i32
%28 = icmp eq i32 %25, %27
ret i1 %28
}

LLVM IR (-O2):
define zeroext i1 @__atomic_compare_exchange_1(i8* %0, i8* nocapture %1, i8 zeroext %2, i1 zeroext %3, i32 %4, i32 %5) {
%7 = load i8, i8* %1
%8 = tail call i8 asm sideeffect "lock cmpxchgb $2,$1\0A", "={ax},=*m,q,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8 %2, i8 %7, i8* elementtype(i8) %0)
store i8 %8, i8* %1
%9 = icmp eq i8 %8, %7
ret i1 %9
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_PO3030K(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


x86 assembly (clang, -O0):
<SensorGetReg_PO3030K>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_PO3030K>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

LLVM IR (-O0):
define void @SensorGetReg_PO3030K(i8 zeroext %0, i16* %1) {
%3 = alloca i8
%4 = alloca i16*
store i8 %0, i8* %3
store i16* %1, i16** %4
%5 = load i8, i8* %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @VIM_SIF_I2cReadByte(i8 zeroext %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @SensorGetReg_PO3030K(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, int);
int how_many_percent_life(int vie_tot, int vie_rest) {
  float vie_actu;
  vie_actu = vie_rest / 100;
  printf("%f / %d Sante\n", vie_actu, vie_tot);
  return (vie_actu);
}


x86 assembly (clang, -O0):
<how_many_percent_life>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x4(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
cvttss2si -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<how_many_percent_life>:
push   %rax
mov    %edi,%eax
movslq %esi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
cvtsi2ss %ecx,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
cvttss2si 0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%f / %d Sante\0A\00"
define i32 @how_many_percent_life(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 100
%8 = sitofp i32 %7 to float
store float %8, float* %5
%9 = load float, float* %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %9, i32 %10)
%12 = load float, float* %5
%13 = fptosi float %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"%f / %d Sante\0A\00"
define i32 @how_many_percent_life(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 100
%4 = sitofp i32 %3 to float
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %4, i32 %0)
%6 = fptosi float %4 to i32
ret i32 %6
}
char *strcat(s, add)
register char *s, *add;
{
  register char *ret = s;
  while (*s)
    s++;
  while ((*s++ = *add++) != 0)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <strcat+0x6a>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
unsigned float_abs(unsigned uf) {
  unsigned r = uf & 0x7fffffff;
  if (r > 0x7f800000)
    return uf;
  return r;
}


x86 assembly (clang, -O0):
<float_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7f800000,-0xc(%rbp)
jbe    112a <float_abs+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <float_abs+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_abs>:
mov    %edi,%eax
and    $0x7fffffff,%eax
cmp    $0x7f800001,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @float_abs(i32 %0) {
%2 = and i32 %0, 2147483647
%3 = icmp ugt i32 %2, 2139095040
%4 = select i1 %3, i32 %0, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ test_inf();
int /*<<< orphan*/ test_nan();
int main(void) {
  assert(test_nan());
  assert(test_inf());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_nan@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <test_inf@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_nan()
%3 = call i32 @assert(i32 %2)
%4 = call i32 (...) @test_inf()
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_nan()
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 (...) @test_inf()
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
const char *db_drop_users_table_sql(void) {
  static const char *query = "DROP TABLE users";
  return query;
}


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

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

LLVM IR (-O0):
@db_drop_users_table_sql.query = internal global i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0)
@.str = [17 x i8] c"DROP TABLE users\00"
define i8* @db_drop_users_table_sql() {
%1 = load i8*, i8** @db_drop_users_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [17 x i8] c"DROP TABLE users\00"
define i8* @db_drop_users_table_sql() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ u_int;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_string(int /*<<< orphan*/ *, char **, scalar_t__);
bool_t xdr_wrapstring(XDR *xdrs, char **cpp) {
  return xdr_string(xdrs, cpp, ((u_int)0 - 1));
}


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

x86 assembly (clang, -O2):
<xdr_wrapstring>:
mov    $0xffffffffffffffff,%rdx
jmp    1030 <xdr_string@plt>

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

LLVM IR (-O2):
define i32 @xdr_wrapstring(i32* %0, i8** %1) {
%3 = tail call i32 @xdr_string(i32* %0, i8** %1, i64 -1)
ret i32 %3
}
int foo() {
  int x[10];
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [10 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
int vect_count_spaces(const char *s) {
  int count = 0;
  do {
    if (*s == ' ')
      count++;
    s++;
  } while (*s != '\0');
  return count;
}


x86 assembly (clang, -O0):
<vect_count_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1128 <vect_count_spaces+0x28>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    110f <vect_count_spaces+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vect_count_spaces>:
mov    (%rdi),%cl
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
cmp    $0x20,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <vect_count_spaces+0x10>
ret

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

LLVM IR (-O2):
define i32 @vect_count_spaces(i8* nocapture %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %3, %1
%4 = phi i8 [ %2, %1 ], [ %11, %3 ]
%5 = phi i8* [ %0, %1 ], [ %10, %3 ]
%6 = phi i32 [ 0, %1 ], [ %9, %3 ]
%7 = icmp eq i8 %4, 32
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %3
13: ; preds = %3
ret i32 %9
}
/* Variables and functions */
scalar_t__ neio_putc(char);
scalar_t__ neio_puts(char const *);
int neio_putln(const char *s) {
  do {
    if ((neio_puts(s)))
      return -1;
  } while (0);
  do {
    if ((neio_putc('\n')))
      return -1;
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<neio_putln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <neio_puts@plt>
cmp    $0x0,%rax
je     114b <neio_putln+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <neio_putln+0x61>
jmp    1150 <neio_putln+0x30>
jmp    1155 <neio_putln+0x35>
mov    $0xa,%edi
call   1030 <neio_putc@plt>
cmp    $0x0,%rax
je     1175 <neio_putln+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <neio_putln+0x61>
jmp    117a <neio_putln+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neio_putln>:
push   %rax
call   1040 <neio_puts@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1135 <neio_putln+0x15>
pop    %rcx
ret
mov    $0xa,%edi
call   1030 <neio_putc@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @neio_putln(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %1
%5 = load i8*, i8** %3
%6 = call i64 @neio_puts(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store i32 -1, i32* %2
br label %17
9: ; preds = %4
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
%12 = call i64 @neio_putc(i8 signext 10)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 -1, i32* %2
br label %17
15: ; preds = %11
br label %16
16: ; preds = %15
store i32 0, i32* %2
br label %17
17: ; preds = %16, %14, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @neio_putln(i8* %0) {
%2 = tail call i64 @neio_puts(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @neio_putc(i8 signext 10)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
void rfs_ungetc(unsigned char c, unsigned char **p) { *p = *p - 1; }


x86 assembly (clang, -O0):
<rfs_ungetc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfs_ungetc>:
addq   $0xffffffffffffffff,(%rsi)
ret

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

LLVM IR (-O2):
define void @rfs_ungetc(i8 zeroext %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 -1
store i8* %4, i8** %1
ret void
}
double *getEl(double *array, int *node, int i, int *n) {
  return array + 19 * (node[2] * n[1] * n[0] + node[1] * n[0] + node[0]) + i;
}


x86 assembly (clang, -O0):
<getEl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x20(%rbp),%rdx
imul   0x4(%rdx),%ecx
mov    -0x20(%rbp),%rdx
imul   (%rdx),%ecx
mov    -0x10(%rbp),%rdx
mov    0x4(%rdx),%edx
mov    -0x20(%rbp),%rsi
imul   (%rsi),%edx
add    %edx,%ecx
mov    -0x10(%rbp),%rdx
add    (%rdx),%ecx
imul   $0x13,%ecx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEl>:
mov    0x4(%rcx),%eax
imul   0x8(%rsi),%eax
add    0x4(%rsi),%eax
imul   (%rcx),%eax
movslq (%rsi),%rcx
cltq
add    %rcx,%rax
imul   $0x98,%rax,%rax
add    %rdi,%rax
movslq %edx,%rcx
lea    (%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
define double* @getEl(double* %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca double*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
store double* %0, double** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load double*, double** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = load i32*, i32** %8
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = mul nsw i32 %12, %15
%17 = load i32*, i32** %8
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = mul nsw i32 %16, %19
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = load i32*, i32** %8
%25 = getelementptr inbounds i32, i32* %24, i64 0
%26 = load i32, i32* %25
%27 = mul nsw i32 %23, %26
%28 = add nsw i32 %20, %27
%29 = load i32*, i32** %6
%30 = getelementptr inbounds i32, i32* %29, i64 0
%31 = load i32, i32* %30
%32 = add nsw i32 %28, %31
%33 = mul nsw i32 19, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %9, i64 %34
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
ret double* %38
}

LLVM IR (-O2):
define double* @getEl(double* readnone %0, i32* nocapture %1, i32 %2, i32* nocapture %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %3, i64 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, %6
%10 = load i32, i32* %3
%11 = getelementptr inbounds i32, i32* %1, i64 1
%12 = load i32, i32* %11
%13 = add i32 %12, %9
%14 = mul i32 %13, %10
%15 = load i32, i32* %1
%16 = add nsw i32 %14, %15
%17 = mul nsw i32 %16, 19
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %0, i64 %18
%20 = sext i32 %2 to i64
%21 = getelementptr inbounds double, double* %19, i64 %20
ret double* %21
}
/* Type definitions */
struct typ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ definition_const(struct typ const *);
size_t node_fun_all_args_count(int /*<<< orphan*/);
int /*<<< orphan*/ typ_is_function(struct typ const *);
size_t typ_function_arity(const struct typ *t) {
  assert(typ_is_function(t));
  return node_fun_all_args_count(definition_const(t));
}


x86 assembly (clang, -O0):
<typ_function_arity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <typ_is_function@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <definition_const@plt>
mov    %eax,%edi
call   1060 <node_fun_all_args_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<typ_function_arity>:
push   %rbx
mov    %rdi,%rbx
call   1030 <typ_is_function@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <definition_const@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <node_fun_all_args_count@plt>

LLVM IR (-O0):
%struct.typ = type { i32 }
define i64 @typ_function_arity(%struct.typ* %0) {
%2 = alloca %struct.typ*
store %struct.typ* %0, %struct.typ** %2
%3 = load %struct.typ*, %struct.typ** %2
%4 = call i32 @typ_is_function(%struct.typ* %3)
%5 = call i32 @assert(i32 %4)
%6 = load %struct.typ*, %struct.typ** %2
%7 = call i32 @definition_const(%struct.typ* %6)
%8 = call i64 @node_fun_all_args_count(i32 %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.typ = type { i32 }
define i64 @typ_function_arity(%struct.typ* %0) {
%2 = tail call i32 @typ_is_function(%struct.typ* %0)
%3 = tail call i32 @assert(i32 %2)
%4 = tail call i32 @definition_const(%struct.typ* %0)
%5 = tail call i64 @node_fun_all_args_count(i32 %4)
ret i64 %5
}
/* Variables and functions */
int wrapper(int, char const *, char *const *, char *const *);
int execvpe(const char *__file, char *const __argv[], char *const __envp[]) {
  return wrapper(4, __file, __argv, __envp);
}


x86 assembly (clang, -O0):
<execvpe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x4,%edi
call   1030 <wrapper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execvpe>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <wrapper@plt>

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

LLVM IR (-O2):
define i32 @execvpe(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @wrapper(i32 4, i8* %0, i8** %1, i8** %2)
ret i32 %4
}
double exp_mean(const double lambda) { return 0.5 * lambda; }


x86 assembly (clang, -O0):
<exp_mean>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_mean>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @exp_mean(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 5.000000e-01, %3
ret double %4
}

LLVM IR (-O2):
define double @exp_mean(double %0) {
%2 = fmul double %0, 5.000000e-01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ jstp_tx_char(char);
void jstp_tx_array_end_item() { jstp_tx_char(','); }


x86 assembly (clang, -O0):
<jstp_tx_array_end_item>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
call   1030 <jstp_tx_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jstp_tx_array_end_item>:
mov    $0x2c,%edi
jmp    1030 <jstp_tx_char@plt>

LLVM IR (-O0):
define void @jstp_tx_array_end_item() {
%1 = call i32 @jstp_tx_char(i8 signext 44)
ret void
}

LLVM IR (-O2):
define void @jstp_tx_array_end_item() {
%1 = tail call i32 @jstp_tx_char(i8 signext 44)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: %s [-EIQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] "
                "[terminal]\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"usage: %s [-EIQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"usage: %s [-EIQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void freeDoubleArray(double **someArray, int rows) {
  int i;
  for (i = 0; i < rows; i++) {
    free(someArray[i]);
  }
  free(someArray);
}


x86 assembly (clang, -O0):
<freeDoubleArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeDoubleArray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeDoubleArray+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeDoubleArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeDoubleArray+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeDoubleArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeDoubleArray(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_SYS_GetOsc0ExternalRefClockFreq();
uint32_t CLOCK_SYS_GetAdcAltFreq(uint32_t instance) {
  (void)instance;
  return CLOCK_SYS_GetOsc0ExternalRefClockFreq();
}


x86 assembly (clang, -O0):
<CLOCK_SYS_GetAdcAltFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <CLOCK_SYS_GetOsc0ExternalRefClockFreq@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CLOCK_SYS_GetAdcAltFreq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @CLOCK_SYS_GetOsc0ExternalRefClockFreq()
ret i32 %4
}

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetAdcAltFreq(i32 %0) {
%2 = tail call i32 (...) @CLOCK_SYS_GetOsc0ExternalRefClockFreq()
ret i32 %2
}
/* Variables and functions */
double loglike_theta(double *, int, void *, int *);
double loglike_(double *x, int n, void *output, int *winfo) {
  return loglike_theta(x, n, output, winfo);
}


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

x86 assembly (clang, -O2):
<loglike_>:
jmp    1030 <loglike_theta@plt>

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

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