xunge/DecIR huggingface dataset:
void fun_0(int *arr1, int index, int *arr2) {
  arr1[index + 1] = 10;
  *--arr2 = 30;
  arr1[index + 2] = 20;
  *--arr2 = 40;
}


x86 assembly (clang, -O0):
<fun_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movl   $0xa,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x1e,-0x4(%rax)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movl   $0x14,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x28,-0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_0>:
movslq %esi,%rax
movl   $0xa,0x4(%rdi,%rax,4)
movl   $0x1e,-0x4(%rdx)
movl   $0x14,0x8(%rdi,%rax,4)
movl   $0x28,-0x8(%rdx)
ret

LLVM IR (-O0):
define void @fun_0(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
store i32 10, i32* %11
%12 = load i32*, i32** %6
%13 = getelementptr inbounds i32, i32* %12, i32 -1
store i32* %13, i32** %6
store i32 30, i32* %13
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
store i32 20, i32* %18
%19 = load i32*, i32** %6
%20 = getelementptr inbounds i32, i32* %19, i32 -1
store i32* %20, i32** %6
store i32 40, i32* %20
ret void
}

LLVM IR (-O2):
define void @fun_0(i32* nocapture writeonly %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %1, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 10, i32* %6
%7 = getelementptr inbounds i32, i32* %2, i64 -1
store i32 30, i32* %7
%8 = add nsw i32 %1, 2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 20, i32* %10
%11 = getelementptr inbounds i32, i32* %2, i64 -2
store i32 40, i32* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
void before_tag(WINDOW *win) {
  init_pair(2, COLOR_RED, COLOR_BLACK);
  wattron(win, COLOR_PAIR(2));
}


x86 assembly (clang, -O0):
<before_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <COLOR_PAIR@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <wattron@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<before_tag>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    $0x2,%edi
call   1040 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <wattron@plt>

LLVM IR (-O0):
@COLOR_RED = global i32 0
@COLOR_BLACK = global i32 0
define void @before_tag(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @COLOR_RED
%4 = load i32, i32* @COLOR_BLACK
%5 = call i32 @init_pair(i32 2, i32 %3, i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @COLOR_PAIR(i32 2)
%8 = call i32 @wattron(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@COLOR_RED = global i32 0
@COLOR_BLACK = global i32 0
define void @before_tag(i32* %0) {
%2 = load i32, i32* @COLOR_RED
%3 = load i32, i32* @COLOR_BLACK
%4 = tail call i32 @init_pair(i32 2, i32 %2, i32 %3)
%5 = tail call i32 @COLOR_PAIR(i32 2)
%6 = tail call i32 @wattron(i32* %0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void Read_array(int A[], int n) {
  int i;
  for (i = 0; i < n; i++)
    scanf("%d", &A[i]);
}


x86 assembly (clang, -O0):
<Read_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <Read_array+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Read_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <Read_array+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <Read_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @Read_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @Read_array(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
void convertfile(char *sourcepath, char *targetpath) {}


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

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

LLVM IR (-O0):
define void @convertfile(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 @convertfile(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n1 = 5, n2 = 6, n3;
  n3 = n1 ^ n2;
  printf("n1 ^ n2 = %d\n", n3);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"n1 ^ n2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  int a, b, c, d;
  double result;
  a = 1;
  b = 2;
  c = 3;
  d = 4;
  result = a + b - c * d / 10;
  printf("%f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 2.000000e+00)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int UINT64_C(int);
int time(int /*<<< orphan*/ *);
uint64_t monotonic_useconds() { return UINT64_C(1000000) * time(NULL); }


x86 assembly (clang, -O0):
<monotonic_useconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf4240,%edi
call   1030 <UINT64_C@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotonic_useconds>:
push   %rbx
mov    $0xf4240,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <time@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @monotonic_useconds() {
%1 = call i32 @UINT64_C(i32 1000000)
%2 = call i32 @time(i32* null)
%3 = mul nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @monotonic_useconds() {
%1 = tail call i32 @UINT64_C(i32 1000000)
%2 = tail call i32 @time(i32* null)
%3 = mul nsw i32 %2, %1
ret i32 %3
}
unsigned int val(const char *p) { return (p[0] << 16 | p[1] << 8 | p[2]); }


x86 assembly (clang, -O0):
<val>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val>:
movsbl (%rdi),%eax
shl    $0x10,%eax
movsbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movsbl 0x2(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @val(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 16
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = or i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @val(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = or i32 %9, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcharacterarray_(char *x, unsigned int *n) { pushNarray(x, *n); }


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

x86 assembly (clang, -O2):
<pushcharacterarray_>:
mov    (%rsi),%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushcharacterarray_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
void OCSP_RESPDATA_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_RESPDATA_free() {
ret void
}
/* Variables and functions */
void *__wstr_dup(void const *);
void *wtypeStr_clone(const void *element) {
  return element ? __wstr_dup(element) : NULL;
}


x86 assembly (clang, -O0):
<wtypeStr_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <wtypeStr_clone+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <__wstr_dup@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <wtypeStr_clone+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <wtypeStr_clone+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtypeStr_clone>:
test   %rdi,%rdi
je     111a <wtypeStr_clone+0xa>
jmp    1030 <__wstr_dup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @wtypeStr_clone(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i8* @__wstr_dup(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @wtypeStr_clone(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @__wstr_dup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
scalar_t__ sxml_alloc(int);
char *string_strdup(const char *str) {
  int len;
  char *copy;
  len = strlen(str) + 1;
  if (!(copy = (char *)sxml_alloc(len)))
    return NULL;
  memcpy(copy, str, len);
  return copy;
}


x86 assembly (clang, -O0):
<string_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <sxml_alloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    116e <string_strdup+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1186 <string_strdup+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <sxml_alloc@plt>
test   %rax,%rax
je     115f <string_strdup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
jmp    1161 <string_strdup+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @string_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @sxml_alloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %3)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ test_rle_decompress_int16();
int /*<<< orphan*/ test_rle_decompress_int32();
int /*<<< orphan*/ test_rle_decompress_int64();
int /*<<< orphan*/ test_rle_decompress_int8();
int /*<<< orphan*/ test_rle_decompress_uint16();
int /*<<< orphan*/ test_rle_decompress_uint32();
int /*<<< orphan*/ test_rle_decompress_uint64();
int /*<<< orphan*/ test_rle_decompress_uint8();
void test_rle_decompression(void) {
  test_rle_decompress_int8();
  test_rle_decompress_int16();
  test_rle_decompress_int32();
  test_rle_decompress_int64();
  test_rle_decompress_uint8();
  test_rle_decompress_uint16();
  test_rle_decompress_uint32();
  test_rle_decompress_uint64();
}


x86 assembly (clang, -O0):
<test_rle_decompression>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <test_rle_decompress_int8@plt>
mov    $0x0,%al
call   1080 <test_rle_decompress_int16@plt>
mov    $0x0,%al
call   10a0 <test_rle_decompress_int32@plt>
mov    $0x0,%al
call   1050 <test_rle_decompress_int64@plt>
mov    $0x0,%al
call   1070 <test_rle_decompress_uint8@plt>
mov    $0x0,%al
call   1040 <test_rle_decompress_uint16@plt>
mov    $0x0,%al
call   1030 <test_rle_decompress_uint32@plt>
mov    $0x0,%al
call   1060 <test_rle_decompress_uint64@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rle_decompression>:
push   %rax
xor    %eax,%eax
call   1090 <test_rle_decompress_int8@plt>
xor    %eax,%eax
call   1080 <test_rle_decompress_int16@plt>
xor    %eax,%eax
call   10a0 <test_rle_decompress_int32@plt>
xor    %eax,%eax
call   1050 <test_rle_decompress_int64@plt>
xor    %eax,%eax
call   1070 <test_rle_decompress_uint8@plt>
xor    %eax,%eax
call   1040 <test_rle_decompress_uint16@plt>
xor    %eax,%eax
call   1030 <test_rle_decompress_uint32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_rle_decompress_uint64@plt>

LLVM IR (-O0):
define void @test_rle_decompression() {
%1 = call i32 (...) @test_rle_decompress_int8()
%2 = call i32 (...) @test_rle_decompress_int16()
%3 = call i32 (...) @test_rle_decompress_int32()
%4 = call i32 (...) @test_rle_decompress_int64()
%5 = call i32 (...) @test_rle_decompress_uint8()
%6 = call i32 (...) @test_rle_decompress_uint16()
%7 = call i32 (...) @test_rle_decompress_uint32()
%8 = call i32 (...) @test_rle_decompress_uint64()
ret void
}

LLVM IR (-O2):
define void @test_rle_decompression() {
%1 = tail call i32 (...) @test_rle_decompress_int8()
%2 = tail call i32 (...) @test_rle_decompress_int16()
%3 = tail call i32 (...) @test_rle_decompress_int32()
%4 = tail call i32 (...) @test_rle_decompress_int64()
%5 = tail call i32 (...) @test_rle_decompress_uint8()
%6 = tail call i32 (...) @test_rle_decompress_uint16()
%7 = tail call i32 (...) @test_rle_decompress_uint32()
%8 = tail call i32 (...) @test_rle_decompress_uint64()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void utl_mem_swap(void *pA, void *pB, void *pTemp, size_t Len) {
  memcpy(pTemp, pA, Len);
  memcpy(pA, pB, Len);
  memcpy(pB, pTemp, Len);
}


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

x86 assembly (clang, -O2):
<utl_mem_swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rdx,%rdi
mov    %r12,%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @utl_mem_swap(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %8
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i64, i64* %8
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
ret void
}

LLVM IR (-O2):
define void @utl_mem_swap(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %2, i8* %0, i64 %3)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %3)
%7 = tail call i32 @memcpy(i8* %1, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cc1101_strobe(int, int);
int /*<<< orphan*/ cc1101_wr_reg(int, int);
void cc1101_start_rx() {
  cc1101_strobe(0x3A, 0x00u);
  cc1101_wr_reg(0x00, 0x07);
  cc1101_strobe(0x34, 0x00u);
}


x86 assembly (clang, -O0):
<cc1101_start_rx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3a,%edi
xor    %esi,%esi
call   1040 <cc1101_strobe@plt>
xor    %edi,%edi
mov    $0x7,%esi
call   1030 <cc1101_wr_reg@plt>
mov    $0x34,%edi
xor    %esi,%esi
call   1040 <cc1101_strobe@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc1101_start_rx>:
push   %rax
mov    $0x3a,%edi
xor    %esi,%esi
call   1040 <cc1101_strobe@plt>
xor    %edi,%edi
mov    $0x7,%esi
call   1030 <cc1101_wr_reg@plt>
mov    $0x34,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <cc1101_strobe@plt>

LLVM IR (-O0):
define void @cc1101_start_rx() {
%1 = call i32 @cc1101_strobe(i32 58, i32 0)
%2 = call i32 @cc1101_wr_reg(i32 0, i32 7)
%3 = call i32 @cc1101_strobe(i32 52, i32 0)
ret void
}

LLVM IR (-O2):
define void @cc1101_start_rx() {
%1 = tail call i32 @cc1101_strobe(i32 58, i32 0)
%2 = tail call i32 @cc1101_wr_reg(i32 0, i32 7)
%3 = tail call i32 @cc1101_strobe(i32 52, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void s_thread_pthreads_thread_exit(void *ret) { pthread_exit(ret); }


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

x86 assembly (clang, -O2):
<s_thread_pthreads_thread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @s_thread_pthreads_thread_exit(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hola Mundo!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hola Mundo!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_80int8_mem(signed char *val) {
  return ((*val) & (-0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80int8_mem>:
cmpb   $0x0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_80int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -128
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_80int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, -1
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ tcdrain(int);
int write(int, unsigned char *, int);
int write_plc_tty(int ttyfd, unsigned char *buf, int blen) {
  if (write(ttyfd, buf, blen) != blen) {
    return -1;
  }
  tcdrain(ttyfd);
  return blen;
}


x86 assembly (clang, -O0):
<write_plc_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <write@plt>
cmp    -0x14(%rbp),%eax
je     1156 <write_plc_tty+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <write_plc_tty+0x44>
mov    -0x8(%rbp),%edi
call   1030 <tcdrain@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_plc_tty>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
call   1040 <write@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ebx,%ecx
jne    1140 <write_plc_tty+0x20>
mov    %ebp,%edi
call   1030 <tcdrain@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @write_plc_tty(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @tcdrain(i32 %0)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %2, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void go_to_xy(int x, int y) { printf("%c[%d;%df", 0x1B, y + 1, x + 1); }


x86 assembly (clang, -O0):
<go_to_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
lea    0xecf(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_to_xy>:
lea    0x1(%rsi),%edx
lea    0x1(%rdi),%ecx
lea    0xee3(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%d;%df\00"
define void @go_to_xy(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = add nsw i32 %0, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int _read(uint8_t *buf, int len) { return -1; }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_read(i32* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *mem = malloc(size);
  if (mem == NULL && size != 0)
    abort();
  return mem;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <safe_malloc+0x36>
cmpq   $0x0,-0x8(%rbp)
je     1156 <safe_malloc+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1133 <safe_malloc+0x13>
test   %rax,%rax
je     1135 <safe_malloc+0x15>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, scalar_t__, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
scalar_t__ strlen(char const *);
void writecomment(FILE *fp, const char *comment) {
  char str[50];
  fwrite(comment, strlen(comment), 1, fp);
  memset(str, 0, 42);
  fwrite(str, 42 - strlen(comment), 1, fp);
}


x86 assembly (clang, -O0):
<writecomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x60(%rbp),%rdi
mov    %rax,%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x2a,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    $0x2a,%esi
sub    %rax,%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writecomment>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
mov    %rsp,%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x2a,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x2a,%esi
sub    %rax,%rsi
mov    %r15,%rdi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @writecomment(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca [50 x i8]
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = load i32*, i32** %3
%10 = call i32 @fwrite(i8* %6, i64 %8, i32 1, i32* %9)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%12 = call i32 @memset(i8* %11, i32 0, i32 42)
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
%16 = sub nsw i64 42, %15
%17 = load i32*, i32** %3
%18 = call i32 @fwrite(i8* %13, i64 %16, i32 1, i32* %17)
ret void
}

LLVM IR (-O2):
define void @writecomment(i32* nocapture %0, i8* nocapture %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = tail call i32 @fwrite(i8* %1, i64 %5, i32 1, i32* %0)
%7 = call i32 @memset(i8* %4, i32 0, i32 42)
%8 = call i64 @strlen(i8* dereferenceable(1) %1)
%9 = sub nsw i64 42, %8
%10 = call i32 @fwrite(i8* %4, i64 %9, i32 1, i32* %0)
ret void
}
void pack32(unsigned char *x, unsigned long u) {
  x[0] = u;
  u >>= 8;
  x[1] = u;
  u >>= 8;
  x[2] = u;
  u >>= 8;
  x[3] = u;
}


x86 assembly (clang, -O0):
<pack32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @pack32(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 = trunc i64 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i64, i64* %4
%10 = lshr i64 %9, 8
store i64 %10, i64* %4
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i64, i64* %4
%16 = lshr i64 %15, 8
store i64 %16, i64* %4
%17 = load i64, i64* %4
%18 = trunc i64 %17 to i8
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i64, i64* %4
%22 = lshr i64 %21, 8
store i64 %22, i64* %4
%23 = load i64, i64* %4
%24 = trunc i64 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @pack32(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
store i8 %3, i8* %0
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %1, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %1, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int nchoosek(int n, int k) {
  if (k == 0) {
    return 1;
  }
  return (n * nchoosek(n - 1, k - 1)) / k;
}


x86 assembly (clang, -O0):
<nchoosek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <nchoosek+0x24>
movl   $0x1,-0x4(%rbp)
jmp    115a <nchoosek+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <nchoosek@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nchoosek>:
test   %esi,%esi
je     1138 <nchoosek+0x28>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    -0x1(%r14),%edi
lea    -0x1(%rbx),%esi
call   1030 <nchoosek@plt>
imul   %r14d,%eax
cltd
idiv   %ebx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nchoosek(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %11, %6 ], [ 1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = add nsw i32 %1, -1
%9 = tail call i32 @nchoosek(i32 %7, i32 %8)
%10 = mul nsw i32 %9, %0
%11 = sdiv i32 %10, %1
br label %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_mixed_volume_of_supports(int *mv) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(239, mv, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_mixed_volume_of_supports>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xef,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_mixed_volume_of_supports>:
mov    %rdi,%rsi
mov    $0xef,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_mixed_volume_of_supports(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 239, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_mixed_volume_of_supports(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 239, i32* %0, i32* undef, double* undef)
ret i32 %2
}
double recp(double x) { return 1.0 / x; }


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

x86 assembly (clang, -O2):
<recp>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @recp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @recp(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
void bar_pthread() {}


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

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

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

LLVM IR (-O2):
define void @bar_pthread() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int _vscnprintf(char *buf, size_t size, const char *fmt, va_list args) {
  int i;
  i = vsnprintf(buf, size, fmt, args);
  if (i <= 0) {
    return 0;
  }
  if (i < size) {
    return i;
  }
  return size - 1;
}


x86 assembly (clang, -O0):
<_vscnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jg     1154 <_vscnprintf+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1178 <_vscnprintf+0x68>
movslq -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    116d <_vscnprintf+0x5d>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <_vscnprintf+0x68>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vscnprintf>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vsnprintf@plt>
test   %eax,%eax
jle    112b <_vscnprintf+0x1b>
mov    %eax,%ecx
cmp    %rbx,%rcx
jb     1129 <_vscnprintf+0x19>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_vscnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = icmp slt i32 %5, 1
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = zext i32 %5 to i64
%9 = icmp ult i64 %8, %1
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = trunc i64 %1 to i32
%12 = add i32 %11, -1
br label %13
13: ; preds = %7, %4, %10
%14 = phi i32 [ %12, %10 ], [ 0, %4 ], [ %5, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int _exit(int val) {
  exit(val);
  return (-1);
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define i32 @_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
double cosine(int);
double sine(int);
double tangent(int a) {
  double x = sine(a) / cosine(a);
  return x;
}


x86 assembly (clang, -O0):
<tangent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sine@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cosine@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tangent>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1040 <sine@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <cosine@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @tangent(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call double @sine(i32 %4)
%6 = load i32, i32* %2
%7 = call double @cosine(i32 %6)
%8 = fdiv double %5, %7
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @tangent(i32 %0) {
%2 = tail call double @sine(i32 %0)
%3 = tail call double @cosine(i32 %0)
%4 = fdiv double %2, %3
ret double %4
}
unsigned char sum(unsigned int a, unsigned int b) {
  int c = a + b;
  return c < 255 ? c : 255;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jge    112b <sum+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <sum+0x38>
mov    $0xff,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <sum+0x38>
mov    -0x10(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @sum(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* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 255
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %5
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i32 [ %12, %11 ], [ 255, %13 ]
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @sum(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp slt i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ EAC_add_all_objects();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
void EAC_init(void) {
  OpenSSL_add_all_algorithms();
  EAC_add_all_objects();
}


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

x86 assembly (clang, -O2):
<EAC_init>:
push   %rax
xor    %eax,%eax
call   1030 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <EAC_add_all_objects@plt>

LLVM IR (-O0):
define void @EAC_init() {
%1 = call i32 (...) @OpenSSL_add_all_algorithms()
%2 = call i32 (...) @EAC_add_all_objects()
ret void
}

LLVM IR (-O2):
define void @EAC_init() {
%1 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%2 = tail call i32 (...) @EAC_add_all_objects()
ret void
}