xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ keyPressed(unsigned char, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void menuEvents(int opt) {
  if (opt == 'q')
    exit(0);
  keyPressed((unsigned char)opt, 0, 0);
}


x86 assembly (clang, -O0):
<menuEvents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x71,-0x4(%rbp)
jne    113c <menuEvents+0x1c>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <keyPressed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuEvents>:
cmp    $0x71,%edi
je     1132 <menuEvents+0x12>
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <keyPressed@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @menuEvents(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 113
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = call i32 @keyPressed(i8 zeroext %9, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @menuEvents(i32 %0) {
%2 = icmp eq i32 %0, 113
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
%6 = trunc i32 %0 to i8
%7 = tail call i32 @keyPressed(i8 zeroext %6, i32 0, i32 0)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int xstrcmp(const char *s1, const char *s2) {
  if (!s1 && !s2)
    return 0;
  else if ((s1 && !s2) || (!s1 && s2))
    return 1;
  else
    return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<xstrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <xstrcmp+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <xstrcmp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    118a <xstrcmp+0x7a>
cmpq   $0x0,-0x10(%rbp)
je     1158 <xstrcmp+0x48>
cmpq   $0x0,-0x18(%rbp)
je     116e <xstrcmp+0x5e>
cmpq   $0x0,-0x10(%rbp)
jne    117a <xstrcmp+0x6a>
cmpq   $0x0,-0x18(%rbp)
je     117a <xstrcmp+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    118a <xstrcmp+0x7a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrcmp>:
xor    %eax,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     112f <xstrcmp+0x1f>
test   %rsi,%rsi
setne  %al
test   %rdi,%rdi
setne  %cl
xor    %al,%cl
mov    $0x1,%eax
je     1130 <xstrcmp+0x20>
ret
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @xstrcmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = xor i1 %3, %4
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %6, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_nodata() { printf("[No data block follows header]\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"[No data block follows header]\0A\00"
define void @show_nodata() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"[No data block follows header]\00"
define void @show_nodata() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *cheap_sprintf(char *, char const *, char const *);
char *strapp2(const char *s1, const char *s2) {
  return cheap_sprintf("%s%s", s1, s2);
}


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

x86 assembly (clang, -O2):
<strapp2>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <cheap_sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @strapp2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @cheap_sprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @strapp2(i8* %0, i8* %1) {
%3 = tail call i8* @cheap_sprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %3
}
void ff_hevc_put_hevc_bi_qpel_hv32_8_sse4() {}


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

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

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

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


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"open_max :%d\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 (...) @open_max()
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"open_max :%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @open_max()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void flush_pmem_file(struct file *file, unsigned long start,
                     unsigned long len) {
  return;
}


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

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

LLVM IR (-O0):
%struct.file = type opaque
define void @flush_pmem_file(%struct.file* %0, i64 %1, i64 %2) {
%4 = alloca %struct.file*
%5 = alloca i64
%6 = alloca i64
store %struct.file* %0, %struct.file** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.file = type opaque
define void @flush_pmem_file(%struct.file* nocapture %0, i64 %1, i64 %2) {
ret void
}
void backend_span_domain_default(int nos_threads) {}


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

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

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

LLVM IR (-O2):
define void @backend_span_domain_default(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *skipSpace(char *);
char *skipToken(char *ptr) {
  ptr = skipSpace(ptr);
  while ((((*ptr) != '\0') && (!isspace(*ptr)))) {
    ptr++;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<skipToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skipSpace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1165 <skipToken+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1175 <skipToken+0x55>
jmp    1186 <skipToken+0x66>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1139 <skipToken+0x19>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipToken>:
push   %rbx
call   1040 <skipSpace@plt>
mov    %rax,%rbx
mov    (%rax),%al
test   %al,%al
je     1148 <skipToken+0x28>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1148 <skipToken+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <skipToken+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipToken(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @skipSpace(i8* %3)
store i8* %4, i8** %2
br label %5
5: ; preds = %18, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = call i32 @isspace(i8 signext %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %5
%17 = phi i1 [ false, %5 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %5
21: ; preds = %16
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @skipToken(i8* %0) {
%2 = tail call i8* @skipSpace(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %10
%6 = phi i8 [ %12, %10 ], [ %3, %1 ]
%7 = phi i8* [ %11, %10 ], [ %2, %1 ]
%8 = tail call i32 @isspace(i8 signext %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %1
%15 = phi i8* [ %2, %1 ], [ %11, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void getcwd() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @getcwd() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ command;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int /*<<< orphan*/ stdout;
void erase_line(int n) {
  char command[13];
  snprintf(command, sizeof(command), "%c[%dK", 0x1B, n);
  fprintf(stdout, "%s", command);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<erase_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x11(%rbp),%rdi
mov    -0x4(%rbp),%r8d
mov    $0xd,%esi
lea    0xeb1(%rip),%rdx
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    -0x11(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_line>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r8d
lea    0xebf(%rip),%rdx
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    $0xd,%esi
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
mov    0x2e81(%rip),%rbx
mov    (%rbx),%edi
lea    0xe9f(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dK\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @erase_line(i32 %0) {
%2 = alloca i32
%3 = alloca [13 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %5)
%7 = load i32, i32* @stdout
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dK\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @erase_line(i32 %0) {
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}
/* Variables and functions */
long long __infer_nondet_long_long_int();
long long int llrint(double x) { return __infer_nondet_long_long_int(); }


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

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

LLVM IR (-O0):
define i64 @llrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 (...) @__infer_nondet_long_long_int()
ret i64 %3
}

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = tail call i64 (...) @__infer_nondet_long_long_int()
ret i64 %2
}
int test_imm_2Cint64_midword_reg(long long val) {
  return ((val >> 16) & (0x2C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Cint64_midword_reg>:
test   $0x2c0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Cint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 44
%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_2Cint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2883584
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int DotProduct(int *v1, int *v2) { return v1[0] * v2[0] + v1[1] * v2[1]; }


x86 assembly (clang, -O0):
<DotProduct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x4(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DotProduct>:
mov    (%rsi),%ecx
imul   (%rdi),%ecx
mov    0x4(%rsi),%eax
imul   0x4(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @DotProduct(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = add nsw i32 %11, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @DotProduct(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
ret i32 %11
}
/* Variables and functions */
long double nearbyintl(long double);
long double test5l(long double x) { return nearbyintl(x); }


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

x86 assembly (clang, -O2):
<test5l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <nearbyintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @test5l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.nearbyint.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test5l(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.nearbyint.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void err_app(const char *string, const char *err) {
  fprintf(stderr, "%s: ", string);
  fprintf(stderr, "%s\n", err);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<err_app>:
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
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_app>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%r14
mov    (%r14),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xebb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%s: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @err_app(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%s: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @err_app(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
ret void
}
void rev_str(char *b, char *e) {
  char t;
  while (b < e) {
    t = *b;
    *b = *e;
    *e = t;
    ++b;
    --e;
  }
}


x86 assembly (clang, -O0):
<rev_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1155 <rev_str+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <rev_str+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_str>:
cmp    %rsi,%rdi
jae    112c <rev_str+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl (%rdi),%eax
movzbl 0x1(%rsi),%ecx
mov    %cl,(%rdi)
mov    %al,0x1(%rsi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <rev_str+0x10>
ret

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

LLVM IR (-O2):
define void @rev_str(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
store i8 %8, i8* %5
store i8 %7, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = getelementptr inbounds i8, i8* %6, i64 -1
%11 = icmp ult i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int get_maxxgrid(void) { return 1e6; }


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

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

LLVM IR (-O0):
define i32 @get_maxxgrid() {
ret i32 1000000
}

LLVM IR (-O2):
define i32 @get_maxxgrid() {
ret i32 1000000
}
/* Variables and functions */
int /*<<< orphan*/ ADC_ETC_IRQ0_DriverIRQHandler();
__attribute__((weak)) void ADC_ETC_IRQ0_IRQHandler(void) {
  ADC_ETC_IRQ0_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @ADC_ETC_IRQ0_IRQHandler() {
%1 = tail call i32 (...) @ADC_ETC_IRQ0_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void secure_unlock(pthread_mutex_t *mutex) {
  int rc = pthread_mutex_unlock(mutex);
  if (rc) {
    printf("Failed to unlock mutex");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<secure_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1168 <secure_unlock+0x38>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_unlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
jne    113c <secure_unlock+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Failed to unlock mutex\00"
define void @secure_unlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Failed to unlock mutex\00"
define void @secure_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t header_len_low(size_t header_len) { return (1280 - header_len) & 0xff; }


x86 assembly (clang, -O0):
<header_len_low>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x500,%eax
sub    -0x8(%rbp),%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_len_low>:
neg    %edi
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @header_len_low(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = sub i32 0, %2
%4 = and i32 %3, 255
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void mytmpname(char *temp) {
  static int upos;
  for (;;) {
    sprintf(temp, "fondu%04X-%d", getpid(), ++upos);
    if (access(temp, F_OK) == -1)
      return;
  }
}


x86 assembly (clang, -O0):
<mytmpname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
mov    0x2ee5(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x2edc(%rip)
lea    0xe99(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    118d <mytmpname+0x5d>
add    $0x10,%rsp
pop    %rbp
ret
jmp    113c <mytmpname+0xc>

x86 assembly (clang, -O2):
<mytmpname>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec1(%rip),%r14
mov    0x2e92(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2edf(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x2ed6(%rip)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    1150 <mytmpname+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@mytmpname.upos = internal global i32 0
@.str = [13 x i8] c"fondu%04X-%d\00"
@F_OK = global i32 0
define void @mytmpname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %14, %1
%4 = load i8*, i8** %2
%5 = call i32 (...) @getpid()
%6 = load i32, i32* @mytmpname.upos
%7 = add nsw i32 %6, 1
store i32 %7, i32* @mytmpname.upos
%8 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %2
%10 = load i32, i32* @F_OK
%11 = call i32 @access(i8* %9, i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %3
ret void
14: ; preds = %3
br label %3
}

LLVM IR (-O2):
@mytmpname.upos = internal unnamed_addr global i32 0
@.str = [13 x i8] c"fondu%04X-%d\00"
@F_OK = global i32 0
define void @mytmpname(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @getpid()
%4 = load i32, i32* @mytmpname.upos
%5 = add nsw i32 %4, 1
store i32 %5, i32* @mytmpname.upos
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = load i32, i32* @F_OK
%8 = tail call i32 @access(i8* %0, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *bu_dyn_lib_resolve(void *lib, const char *name) {
  void *ptr;
  ptr = dlsym(lib, name);
  return ptr;
}


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

x86 assembly (clang, -O2):
<bu_dyn_lib_resolve>:
jmp    1030 <dlsym@plt>

LLVM IR (-O0):
define i8* @bu_dyn_lib_resolve(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
%7 = load i8*, i8** %4
%8 = call i8* @dlsym(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @bu_dyn_lib_resolve(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  int a, b;
  b = -8;
  if ((a = b) != 0)
    puts("Value assigned");
  else
    puts("Value is zero");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffff8,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1146 <main+0x36>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
jmp    1152 <main+0x42>
lea    0xec2(%rip),%rdi
call   1030 <puts@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"Value assigned\00"
@.str.1 = [14 x i8] c"Value is zero\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -8, i32* %3
%4 = load i32, i32* %3
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Value assigned\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void g_qsort_with_data() {}


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

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

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

LLVM IR (-O2):
define void @g_qsort_with_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void flushMem() {
  unsigned char *ptr;
  ptr = (unsigned char *)malloc(64 * 1024 * sizeof(unsigned char));
  memset(ptr, 0, 64 * 1024);
  free(ptr);
}


x86 assembly (clang, -O0):
<flushMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10000,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushMem>:
push   %rbx
mov    $0x10000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x10000,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @flushMem() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 65536)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @memset(i8* %4, i32 0, i32 65536)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @flushMem() {
%1 = tail call i64 @malloc(i32 65536)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @memset(i8* %2, i32 0, i32 65536)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int Printf(char *, char *);
int Printc(char *c) { return Printf("%s", c); }


x86 assembly (clang, -O0):
<Printc>:
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):
<Printc>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <Printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @Printc(i8* %0) {
%2 = tail call i32 @Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int *, int *);
int main(void) {
  int x = 10, *pi;
  pi = &x;
  *pi /= 2;
  *pi += 2;
  printf("\n  x=%d  *pi=%d  pi=%p  pi=%ld\n\n", x, *pi, pi, pi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x7,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rcx
mov    $0x7,%esi
mov    $0x7,%edx
mov    %rcx,%r8
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A x=%d *pi=%d pi=%p pi=%ld\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 2
store i32 %6, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 2
store i32 %9, i32* %7
%10 = load i32, i32* %2
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %3
%14 = load i32*, i32** %3
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12, i32* %13, i32* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A x=%d *pi=%d pi=%p pi=%ld\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 7, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 7, i32 7, i32* %1, i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void farenheit(float x) {
  float f;
  f = (9 * x / 5) + 32;
  printf("%.2f\n", f);
}


x86 assembly (clang, -O0):
<farenheit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xed2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xec2(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<farenheit>:
mulss  0xee8(%rip),%xmm0
divss  0xee4(%rip),%xmm0
addss  0xee0(%rip),%xmm0
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define void @farenheit(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float 9.000000e+00, %4
%6 = fdiv float %5, 5.000000e+00
%7 = fadd float %6, 3.200000e+01
store float %7, float* %3
%8 = load float, float* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define void @farenheit(float %0) {
%2 = fmul float %0, 9.000000e+00
%3 = fdiv float %2, 5.000000e+00
%4 = fadd float %3, 3.200000e+01
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %4)
ret void
}
/* Variables and functions */
void *avcodec_alloc_frame();
void *wrapped_frame_alloc() { return avcodec_alloc_frame(); }


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

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

LLVM IR (-O0):
define i8* @wrapped_frame_alloc() {
%1 = call i8* (...) @avcodec_alloc_frame()
ret i8* %1
}

LLVM IR (-O2):
define i8* @wrapped_frame_alloc() {
%1 = tail call i8* (...) @avcodec_alloc_frame()
ret i8* %1
}
void gtk_text_iter_forward_to_end() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_forward_to_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void announce(void) {
  printf("\n\nWelcome to the demonstration CD catalog database program\n");
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"\0A\0AWelcome to the demonstration CD catalog database program\0A\00"
define void @announce() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [59 x i8] c"\0A\0AWelcome to the demonstration CD catalog database program\00"
define void @announce() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, ...);
int main(int argc, char const *argv[]) {
  printf("%x %X %#x", 31, 31, 31);
  printf("**%d**% d**% d**\n", 42, 42, -42);
  printf("**%5d**%5.3d**%05.3d**\n", 6, 6, 6, 6);
  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
mov    $0x1f,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x2a,%edx
mov    $0xffffffd6,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x6,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1f,%edx
mov    $0x1f,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x2a,%esi
mov    $0x2a,%edx
mov    $0xffffffd6,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x6,%esi
mov    $0x6,%edx
mov    $0x6,%ecx
mov    $0x6,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%x %X %#x\00"
@.str.1 = [18 x i8] c"**%d**% d**% d**\0A\00"
@.str.2 = [24 x i8] c"**%5d**%5.3d**%05.3d**\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 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 31, i32 31, i32 31)
%7 = call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 42, i32 42, i32 -42)
%8 = call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 6, i32 6, i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%x %X %#x\00"
@.str.1 = [18 x i8] c"**%d**% d**% d**\0A\00"
@.str.2 = [24 x i8] c"**%5d**%5.3d**%05.3d**\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 31, i32 31, i32 31)
%4 = tail call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 42, i32 42, i32 -42)
%5 = tail call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 6, i32 6, i32 6)
ret i32 0
}
void closepipe(pv) register int *pv;
{
  if (pv != 0) {
    close(*pv++);
    close(*pv);
  }
}


x86 assembly (clang, -O0):
<closepipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <closepipe+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <close@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closepipe>:
test   %rdi,%rdi
je     112d <closepipe+0x1d>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %eax,%eax
call   1030 <close@plt>
mov    0x4(%rbx),%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @closepipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %2
%8 = load i32, i32* %6
%9 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %11)
br label %13
13: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @closepipe(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %0
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %4
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %7)
br label %9
9: ; preds = %3, %1
ret void
}
void populate_package() {}


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

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

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

LLVM IR (-O2):
define void @populate_package() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_hires_timer();
void init_hires_timer_() { init_hires_timer(); }


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

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

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

LLVM IR (-O2):
define void @init_hires_timer_() {
%1 = tail call i32 (...) @init_hires_timer()
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, void *, size_t);
void *m_memdup(void *src, size_t n) {
  char *dst;
  dst = malloc(n);
  memcpy(dst, src, n);
  return (void *)dst;
}


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

x86 assembly (clang, -O2):
<m_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @m_memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @m_memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
void f54(void) {
  ({
    ({ 0; });
    goto a;
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  0;
}


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

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

LLVM IR (-O0):
define void @f54() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %1
br label %4
4: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @f54() {
ret void
}
/* Variables and functions */
int O_RDWR;
int O_TRUNC;
int open(int, int, int /*<<< orphan*/);
int main() {
  int fd = open(0x00000000, O_RDWR | O_TRUNC, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    0x2ec9(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
mov    %edx,%edi
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    0x2ed9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <open@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_TRUNC
%5 = or i32 %3, %4
%6 = call i32 @open(i32 0, i32 %5, i32 0)
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_TRUNC
%3 = or i32 %2, %1
%4 = tail call i32 @open(i32 0, i32 %3, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo() { bar(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
ret void
}