xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wcschr(int const *, int const);
wchar_t *wcspbrk(const wchar_t *wcs, const wchar_t *accept) {
  while (*wcs != L'\0')
    if (wcschr(accept, *wcs) == NULL)
      ++wcs;
    else
      return (wchar_t *)wcs;
  return NULL;
}


x86 assembly (clang, -O0):
<wcspbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1169 <wcspbrk+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <wcschr@plt>
cmp    $0x0,%rax
jne    1157 <wcspbrk+0x47>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1164 <wcspbrk+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <wcspbrk+0x61>
jmp    1120 <wcspbrk+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcspbrk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rdi),%esi
test   %esi,%esi
je     1138 <wcspbrk+0x28>
mov    %rdi,%rbx
mov    %r14,%rdi
call   1030 <wcschr@plt>
test   %rax,%rax
jne    113a <wcspbrk+0x2a>
mov    0x4(%rbx),%esi
add    $0x4,%rbx
test   %esi,%esi
jne    1120 <wcspbrk+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @wcspbrk(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i32 [ %12, %10 ], [ %3, %2 ]
%7 = phi i32* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i32* @wcschr(i32* %1, i32 %6)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %7, i64 1
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i32* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i32* %15
}
int fp_isnan(double x) { return x != x; }


x86 assembly (clang, -O0):
<fp_isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_isnan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @fp_isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fp_isnan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
test11(int *x) {
  while (*x)
    (putchar(*x++));
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1144 <test11+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <test11+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     112f <test11+0x1f>
add    $0x4,%rbx
xchg   %ax,%ax
call   1030 <putchar@plt>
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1120 <test11+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test11(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i32* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = tail call i32 @putchar(i32 %5)
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ purge_file(char *);
int main(int argc, char **argv) {
  int i;
  if (argc < 2) {
    return 1;
  }
  for (i = 1; i < argc; ++i) {
    purge_file(argv[i]);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1175 <main+0x65>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <purge_file@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <main+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1149 <main+0x39>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <purge_file@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @purge_file(i8* %9)
%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 = phi i32 [ 1, %2 ], [ 0, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ HwTauLinkHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HwTauLinkUpdated() { UAVObjUpdated(HwTauLinkHandle()); }


x86 assembly (clang, -O0):
<HwTauLinkUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HwTauLinkHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwTauLinkUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <HwTauLinkHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @HwTauLinkUpdated() {
%1 = call i32 (...) @HwTauLinkHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwTauLinkUpdated() {
%1 = tail call i32 (...) @HwTauLinkHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_log_file() {
  FILE *fp = fopen("/tmp/hwq.log", "a+");
  return fp;
}


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

x86 assembly (clang, -O2):
<open_log_file>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/tmp/hwq.log\00"
@.str.1 = [3 x i8] c"a+\00"
define i32* @open_log_file() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
ret i32* %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"/tmp/hwq.log\00"
@.str.1 = [3 x i8] c"a+\00"
define noalias i32* @open_log_file() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}
void IMGbltRemapHMirror(short *imageBuf, int pitch, int x, int y,
                        char *bitmapBuf, short *colorTable) {}


x86 assembly (clang, -O0):
<IMGbltRemapHMirror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @IMGbltRemapHMirror(i16* %0, i32 %1, i32 %2, i32 %3, i8* %4, i16* %5) {
%7 = alloca i16*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i16*
store i16* %0, i16** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i16* %5, i16** %12
ret void
}

LLVM IR (-O2):
define void @IMGbltRemapHMirror(i16* nocapture %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i16* nocapture %5) {
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char const *);
struct hostent *BIO_gethostbyname(const char *name) {
  return gethostbyname(name);
}


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

x86 assembly (clang, -O2):
<BIO_gethostbyname>:
jmp    1030 <gethostbyname@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
define %struct.hostent* @BIO_gethostbyname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.hostent* @gethostbyname(i8* %3)
ret %struct.hostent* %4
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define %struct.hostent* @BIO_gethostbyname(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
ret %struct.hostent* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void help(char *pname) {
  printf("Usage: %s <source ip> <dest. ip> <neighbor>\n", pname);
  printf("[Use x.x.x.x format]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: %s <source ip> <dest. ip> <neighbor>\0A\00"
@.str.1 = [22 x i8] c"[Use x.x.x.x format]\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"Usage: %s <source ip> <dest. ip> <neighbor>\0A\00"
@str = [21 x i8] c"[Use x.x.x.x format]\00"
define void @help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct statement_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_block();
int /*<<< orphan*/ make_new_block();
struct statement_list *scan_optimize_statement_list(struct statement_list *);
struct statement_list *
scan_statement_list_with_new_block(struct statement_list *list) {
  make_new_block();
  list = scan_optimize_statement_list(list);
  delete_block();
  return list;
}


x86 assembly (clang, -O0):
<scan_statement_list_with_new_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <make_new_block@plt>
mov    -0x8(%rbp),%rdi
call   1050 <scan_optimize_statement_list@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <delete_block@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_statement_list_with_new_block>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <make_new_block@plt>
mov    %rbx,%rdi
call   1050 <scan_optimize_statement_list@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <delete_block@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.statement_list = type { i32 }
define %struct.statement_list* @scan_statement_list_with_new_block(%struct.statement_list* %0) {
%2 = alloca %struct.statement_list*
store %struct.statement_list* %0, %struct.statement_list** %2
%3 = call i32 (...) @make_new_block()
%4 = load %struct.statement_list*, %struct.statement_list** %2
%5 = call %struct.statement_list* @scan_optimize_statement_list(%struct.statement_list* %4)
store %struct.statement_list* %5, %struct.statement_list** %2
%6 = call i32 (...) @delete_block()
%7 = load %struct.statement_list*, %struct.statement_list** %2
ret %struct.statement_list* %7
}

LLVM IR (-O2):
%struct.statement_list = type { i32 }
define %struct.statement_list* @scan_statement_list_with_new_block(%struct.statement_list* %0) {
%2 = tail call i32 (...) @make_new_block()
%3 = tail call %struct.statement_list* @scan_optimize_statement_list(%struct.statement_list* %0)
%4 = tail call i32 (...) @delete_block()
ret %struct.statement_list* %3
}
/* Variables and functions */
int /*<<< orphan*/ maxHeapify(int *, unsigned int, unsigned int);
void buildMaxHeap(int *A, unsigned int length) {
  for (unsigned int i = length / 2 - 1; i >= 0; i--)
    maxHeapify(A, i, length);
}


x86 assembly (clang, -O0):
<buildMaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jb     1152 <buildMaxHeap+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <maxHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <buildMaxHeap+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildMaxHeap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %esi,%ebp
shr    %ebp
add    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <maxHeapify@plt>
add    $0xffffffff,%ebp
jmp    1130 <buildMaxHeap+0x20>

LLVM IR (-O0):
define void @buildMaxHeap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = udiv i32 %6, 2
%8 = sub i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp uge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @maxHeapify(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @buildMaxHeap(i32* %0, i32 %1) {
%3 = lshr i32 %1, 1
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %3, %2 ], [ %6, %4 ]
%6 = add i32 %5, -1
%7 = tail call i32 @maxHeapify(i32* %0, i32 %6, i32 %1)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ bef_push(int);
int ins_nm8() {
  bef_push(8);
  return 1;
}


x86 assembly (clang, -O0):
<ins_nm8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <bef_push@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ins_nm8>:
push   %rax
mov    $0x8,%edi
call   1030 <bef_push@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ins_nm8() {
%1 = call i32 @bef_push(i32 8)
ret i32 1
}

LLVM IR (-O2):
define i32 @ins_nm8() {
%1 = tail call i32 @bef_push(i32 8)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ perform_http_request(char *);
int /*<<< orphan*/ print_usage();
int main(int argc, char **argv) {
  if (argc != 2)
    print_usage();
  perform_http_request(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1147 <main+0x27>
mov    $0x0,%al
call   1040 <print_usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <perform_http_request@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1130 <main+0x10>
xor    %eax,%eax
call   1040 <print_usage@plt>
mov    0x8(%rbx),%rdi
call   1030 <perform_http_request@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @print_usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @perform_http_request(i8* %8)
ret i32 0
}
int fun146() { return 146; }


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

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

LLVM IR (-O0):
define i32 @fun146() {
ret i32 146
}

LLVM IR (-O2):
define i32 @fun146() {
ret i32 146
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void illegalChoice() {
  system("cls");
  printf("ERRORE FATALE\n");
  printf("Valore non consentito!\n");
  system("pause");
  system("cls");
}


x86 assembly (clang, -O0):
<illegalChoice>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <system@plt>
lea    0xea5(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<illegalChoice>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <system@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1040 <system@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [15 x i8] c"ERRORE FATALE\0A\00"
@.str.2 = [24 x i8] c"Valore non consentito!\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define void @illegalChoice() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.3 = [6 x i8] c"pause\00"
@str = [14 x i8] c"ERRORE FATALE\00"
@str.4 = [23 x i8] c"Valore non consentito!\00"
define void @illegalChoice() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buf_read(struct buffer *, int /*<<< orphan*/ *, int);
int ntohs(int /*<<< orphan*/);
int buf_read_u16(struct buffer *buf) {
  uint16_t ret;
  if (!buf_read(buf, &ret, sizeof(uint16_t))) {
    return -1;
  }
  return ntohs(ret);
}


x86 assembly (clang, -O0):
<buf_read_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <buf_read@plt>
cmp    $0x0,%eax
jne    1153 <buf_read_u16+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <buf_read_u16+0x3e>
mov    -0x14(%rbp),%edi
call   1040 <ntohs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_read_u16>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <buf_read@plt>
test   %eax,%eax
je     113f <buf_read_u16+0x1f>
mov    0x4(%rsp),%edi
call   1040 <ntohs@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @buf_read_u16(%struct.buffer* %0) {
%2 = alloca i32
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = call i32 @buf_read(%struct.buffer* %5, i32* %4, i32 4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = call i32 @ntohs(i32 %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buf_read_u16(%struct.buffer* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @buf_read(%struct.buffer* %0, i32* %2, i32 4)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @ntohs(i32 %7)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
long lcm(long, long);
int /*<<< orphan*/ printf(char *, long);
int scanf(char *, long *, long *);
int main() {
  long a, b;
  long LCM;
  int K = scanf("%ld %ld", &a, &b);
  if (K != 2)
    return 1;
  LCM = lcm(a, b);
  printf("%ld\n", LCM);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
je     116c <main+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1194 <main+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <lcm@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jne    1176 <main+0x46>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <lcm@plt>
lea    0xe9c(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i64, i64* %1
%9 = load i64, i64* %2
%10 = call i64 @lcm(i64 %8, i64 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %0, %7
%13 = phi i32 [ 0, %7 ], [ 1, %0 ]
ret i32 %13
}
int log2floor(int x) {
  int r = 1;
  int v = x;
  while (v >>= 1)
    r <<= 1;
  if (r < x)
    r <<= 1;
  return r;
}


x86 assembly (clang, -O0):
<log2floor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1134 <log2floor+0x34>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <log2floor+0x14>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1149 <log2floor+0x49>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2floor>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     112b <log2floor+0x2b>
mov    $0x1,%eax
mov    %edi,%ecx
mov    %edi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
sar    %edx
add    %eax,%eax
cmp    $0x3,%ecx
mov    %edx,%ecx
ja     1120 <log2floor+0x20>
cmp    %edi,%eax
setl   %cl
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @log2floor(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 1, %1 ]
%6 = ashr i32 %4, 1
%7 = shl i32 %5, 1
%8 = icmp ult i32 %4, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
%11 = icmp slt i32 %10, %0
%12 = zext i1 %11 to i32
%13 = shl i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main() {
  long i = 65536 << 16;
  printf("%d\n", i);
  i = 65535 << 16;
  printf("%d\n", i);
  i = -2147483648;
  printf("%d\n", i);
  --i;
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movq   $0xffffffffffff0000,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movq   $0xffffffff80000000,-0x10(%rbp)
80
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 -65536)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 -2147483648)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 -2147483649)
ret i32 0
}
int checkCpuLE() {
  {
    union w {
      int a;
      char b;
    } c;
    c.a = 1;
    return c.b == 1;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @checkCpuLE() {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
void set_XSelectionRequestEvent_serial(void *_p, unsigned long _v) {
  ((XSelectionRequestEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XSelectionRequestEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSelectionRequestEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSelectionRequestEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int power_management_standby() { return -1; }


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

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

LLVM IR (-O0):
define i32 @power_management_standby() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @power_management_standby() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
scalar_t__ COLS;
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/ *, int, int,
                             int /*<<< orphan*/);
int /*<<< orphan*/ padstr(char *, scalar_t__);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void rmline(WINDOW *win, int nr) {
  mvwaddstr(win, nr, 1, padstr(" ", COLS - 2));
  wrefresh(win);
}


x86 assembly (clang, -O0):
<rmline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%rsi
sub    $0x2,%rsi
lea    0xe9e(%rip),%rdi
call   1040 <padstr@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%ecx
mov    $0x1,%edx
call   1050 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmline>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea9(%rip),%rax
mov    (%rax),%rsi
add    $0xfffffffffffffffe,%rsi
lea    0xeb3(%rip),%rdi
call   1040 <padstr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %eax,%ecx
call   1050 <mvwaddstr@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <wrefresh@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@COLS = global i64 0
define void @rmline(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 = load i64, i64* @COLS
%8 = sub nsw i64 %7, 2
%9 = call i32 @padstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = call i32 @mvwaddstr(i32* %5, i32 %6, i32 1, i32 %9)
%11 = load i32*, i32** %3
%12 = call i32 @wrefresh(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@COLS = global i64 0
define void @rmline(i32* %0, i32 %1) {
%3 = load i64, i64* @COLS
%4 = add nsw i64 %3, -2
%5 = tail call i32 @padstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = tail call i32 @mvwaddstr(i32* %0, i32 %1, i32 1, i32 %5)
%7 = tail call i32 @wrefresh(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatalError(char *);
int progressHandler(void *pVdbeLimitFlag) {
  if (*(int *)pVdbeLimitFlag)
    fatalError("too many VDBE cycles");
  return 1;
}


x86 assembly (clang, -O0):
<progressHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1135 <progressHandler+0x25>
lea    0xed0(%rip),%rdi
call   1030 <fatalError@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progressHandler>:
push   %rax
cmpl   $0x0,(%rdi)
je     1122 <progressHandler+0x12>
lea    0xee3(%rip),%rdi
call   1030 <fatalError@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"too many VDBE cycles\00"
define i32 @progressHandler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @fatalError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"too many VDBE cycles\00"
define i32 @progressHandler(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @fatalError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void yyerror(char const *err) {
  printf("Error: %s\n", err);
  exit(1);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef long uint64_t;
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t get_current_time_millis() {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return (tp.tv_sec * 1000L) + (tp.tv_usec / 1000L);
}


x86 assembly (clang, -O0):
<get_current_time_millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_time_millis>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x10(%rsp)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @get_current_time_millis() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sdiv i64 %7, 1000
%9 = add nsw i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @get_current_time_millis() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sdiv i64 %8, 1000
%10 = add nsw i64 %9, %6
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *name = "Andrew";
  printf("Hello %s\n", name);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Andrew\00"
@.str.1 = [10 x i8] c"Hello %s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int kill(int, int /*<<< orphan*/);
int killer(int pid) { return kill(pid, SIGKILL); }


x86 assembly (clang, -O0):
<killer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killer>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGKILL = global i32 0
define i32 @killer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGKILL
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define i32 @killer(i32 %0) {
%2 = load i32, i32* @SIGKILL
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret i32 %3
}
int transform(int c, int (*op)(int)) {
  if (*op)
    return (*op)(c);
  else
    return c;
}


x86 assembly (clang, -O0):
<transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112b <transform+0x2b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%edi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    1131 <transform+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform>:
test   %rsi,%rsi
je     1107 <transform+0x7>
jmp    *%rsi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @transform(i32 %0, i32 (i32)* %1) {
%3 = icmp eq i32 (i32)* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 %1(i32 %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
ret i32 %7
}
void noaction2(char *file, char *line) {}


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

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

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

LLVM IR (-O2):
define void @noaction2(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_fantomas16_ctr_sse();
int /*<<< orphan*/ test_fantomas_sse();
int main() {
  test_fantomas_sse();
  test_fantomas16_ctr_sse();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_fantomas_sse@plt>
xor    %eax,%eax
call   1030 <test_fantomas16_ctr_sse@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_fantomas_sse()
%3 = call i32 (...) @test_fantomas16_ctr_sse()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_fantomas_sse()
%2 = tail call i32 (...) @test_fantomas16_ctr_sse()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, char *argv[]) {
  const char *evil =
      "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*";
  printf("%s", evil);
  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)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [69 x i8] c"X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret i32 0
}