xunge/DecIR huggingface dataset:
/* Variables and functions */
bool sancus_get_drll(long long v, long long a, long long b, int *out) {
  if ((v >= a) && (v <= b)) {
    if (out != NULL)
      *out = (int)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_drll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1153 <sancus_get_drll+0x53>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     1153 <sancus_get_drll+0x53>
cmpq   $0x0,-0x28(%rbp)
je     1147 <sancus_get_drll+0x47>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115a <sancus_get_drll+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_drll>:
xor    %eax,%eax
cmp    %rsi,%rdi
jl     1118 <sancus_get_drll+0x18>
cmp    %rdx,%rdi
jg     1118 <sancus_get_drll+0x18>
mov    $0x1,%eax
test   %rcx,%rcx
je     1118 <sancus_get_drll+0x18>
mov    %edi,(%rcx)
ret

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

LLVM IR (-O2):
define i32 @sancus_get_drll(i64 %0, i64 %1, i64 %2, i32* writeonly %3) {
%5 = icmp slt i64 %0, %1
%6 = icmp sgt i64 %0, %2
%7 = or i1 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = icmp eq i32* %3, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = trunc i64 %0 to i32
store i32 %11, i32* %3
br label %12
12: ; preds = %4, %8, %10
%13 = phi i32 [ 1, %10 ], [ 1, %8 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("main_function\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 = [15 x i8] c"main_function\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"main_function\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ computeMaximalMean(struct Node *);
int /*<<< orphan*/ computeSolution(double *, struct Node *);
int /*<<< orphan*/ deleteTree(struct Node *);
int /*<<< orphan*/ initializeRootBinary(struct Node **, double *, int);
void orderTreeBinary(double *x, double *u, int n) {
  struct Node *root;
  initializeRootBinary(&root, u, n);
  computeMaximalMean(root);
  computeSolution(x, root);
  deleteTree(root);
}


x86 assembly (clang, -O0):
<orderTreeBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1060 <initializeRootBinary@plt>
mov    -0x20(%rbp),%rdi
call   1040 <computeMaximalMean@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <computeSolution@plt>
mov    -0x20(%rbp),%rdi
call   1030 <deleteTree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orderTreeBinary>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1060 <initializeRootBinary@plt>
mov    0x8(%rsp),%rdi
call   1040 <computeMaximalMean@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <computeSolution@plt>
mov    0x8(%rsp),%rdi
call   1030 <deleteTree@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
define void @orderTreeBinary(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca %struct.Node*
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = call i32 @initializeRootBinary(%struct.Node** %7, double* %8, i32 %9)
%11 = load %struct.Node*, %struct.Node** %7
%12 = call i32 @computeMaximalMean(%struct.Node* %11)
%13 = load double*, double** %4
%14 = load %struct.Node*, %struct.Node** %7
%15 = call i32 @computeSolution(double* %13, %struct.Node* %14)
%16 = load %struct.Node*, %struct.Node** %7
%17 = call i32 @deleteTree(%struct.Node* %16)
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @orderTreeBinary(double* %0, double* %1, i32 %2) {
%4 = alloca %struct.Node*
%5 = bitcast %struct.Node** %4 to i8*
%6 = call i32 @initializeRootBinary(%struct.Node** %4, double* %1, i32 %2)
%7 = load %struct.Node*, %struct.Node** %4
%8 = call i32 @computeMaximalMean(%struct.Node* %7)
%9 = load %struct.Node*, %struct.Node** %4
%10 = call i32 @computeSolution(double* %0, %struct.Node* %9)
%11 = load %struct.Node*, %struct.Node** %4
%12 = call i32 @deleteTree(%struct.Node* %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ L0(int /*<<< orphan*/ *);
int /*<<< orphan*/ L1(int /*<<< orphan*/ *);
int /*<<< orphan*/ L2(int /*<<< orphan*/ *);
int /*<<< orphan*/ L3(int /*<<< orphan*/ *);
void L_layer(uint8_t *data) {
  L0(data);
  L1(data);
  L2(data);
  L3(data);
}


x86 assembly (clang, -O0):
<L_layer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <L0@plt>
mov    -0x8(%rbp),%rdi
call   1040 <L1@plt>
mov    -0x8(%rbp),%rdi
call   1060 <L2@plt>
mov    -0x8(%rbp),%rdi
call   1030 <L3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L_layer>:
push   %rbx
mov    %rdi,%rbx
call   1050 <L0@plt>
mov    %rbx,%rdi
call   1040 <L1@plt>
mov    %rbx,%rdi
call   1060 <L2@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <L3@plt>

LLVM IR (-O0):
define void @L_layer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @L0(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @L1(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @L2(i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @L3(i32* %9)
ret void
}

LLVM IR (-O2):
define void @L_layer(i32* %0) {
%2 = tail call i32 @L0(i32* %0)
%3 = tail call i32 @L1(i32* %0)
%4 = tail call i32 @L2(i32* %0)
%5 = tail call i32 @L3(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ systemwidth();
void basSystemWidth() { pushNumber(systemwidth()); }


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

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

LLVM IR (-O0):
define void @basSystemWidth() {
%1 = call i32 (...) @systemwidth()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basSystemWidth() {
%1 = tail call i32 (...) @systemwidth()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
void HplAtm128Timer0AsyncP$Timer0$overflow(void) {
  Atm128AlarmAsyncP$0$Timer$overflow();
}


x86 assembly (clang, -O0):
<HplAtm128Timer0AsyncP$Timer0$overflow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Atm128AlarmAsyncP$0$Timer$overflow@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HplAtm128Timer0AsyncP$Timer0$overflow>:
xor    %eax,%eax
jmp    1030 <Atm128AlarmAsyncP$0$Timer$overflow@plt>

LLVM IR (-O0):
define void @"HplAtm128Timer0AsyncP$Timer0$overflow"() {
%1 = call i32 (...) @"Atm128AlarmAsyncP$0$Timer$overflow"()
ret void
}

LLVM IR (-O2):
define void @"HplAtm128Timer0AsyncP$Timer0$overflow"() {
%1 = tail call i32 (...) @"Atm128AlarmAsyncP$0$Timer$overflow"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_error_to_queue(int);
int /*<<< orphan*/ process_id_message(void *);
int process_wmanager_message(unsigned int len, int type, void *message) {
  if (*((int *)(message)) == 0)
    add_error_to_queue(-1);
  else {
    process_id_message(message);
    add_error_to_queue(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<process_wmanager_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    114e <process_wmanager_message+0x2e>
mov    $0xffffffff,%edi
call   1040 <add_error_to_queue@plt>
jmp    115e <process_wmanager_message+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <process_id_message@plt>
xor    %edi,%edi
call   1040 <add_error_to_queue@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_wmanager_message>:
push   %rax
cmpl   $0x0,(%rdx)
je     1132 <process_wmanager_message+0x12>
mov    %rdx,%rdi
call   1030 <process_id_message@plt>
xor    %edi,%edi
jmp    1137 <process_wmanager_message+0x17>
mov    $0xffffffff,%edi
call   1040 <add_error_to_queue@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @process_wmanager_message(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @add_error_to_queue(i32 -1)
br label %17
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 @process_id_message(i8* %14)
%16 = call i32 @add_error_to_queue(i32 0)
br label %17
17: ; preds = %13, %11
ret i32 0
}

LLVM IR (-O2):
define i32 @process_wmanager_message(i32 %0, i32 %1, i8* %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @process_id_message(i8* %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 0, %7 ], [ -1, %3 ]
%11 = tail call i32 @add_error_to_queue(i32 %10)
ret i32 0
}
int extract_uint8(unsigned char *p, int halfwordid) {
  unsigned char r;
  unsigned char *b = p;
  b += (halfwordid - 1) * 2;
  r = b[0];
  return ((int)r);
}


x86 assembly (clang, -O0):
<extract_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_uint8>:
lea    (%rsi,%rsi,1),%eax
add    $0xfffffffe,%eax
cltq
movzbl (%rdi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define i32 @extract_uint8(i8* nocapture %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = add i32 %3, -2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
ret i32 %8
}
int fib(int n) {
  if (n == 0 || n == 1) {
    return 1;
  }
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <fib+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113b <fib+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <fib+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <fib+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
void free_matrix(double **m, long nrl, long nrh, long ncl, long nch) {
  free(m[nrl] + ncl - 1);
  free(m + nrl - 1);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(double** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca double**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store double** %0, double*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load double**, double*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds double*, double** %11, i64 %12
%14 = load double*, double** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds double, double* %14, i64 %15
%17 = getelementptr inbounds double, double* %16, i64 -1
%18 = bitcast double* %17 to i8*
%19 = load double**, double*** %6
%20 = load i64, i64* %7
%21 = getelementptr inbounds double*, double** %19, i64 %20
%22 = getelementptr inbounds double*, double** %21, i64 -1
%23 = bitcast double** %22 to i8*
ret void
}

LLVM IR (-O2):
define void @free_matrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 %3
%9 = getelementptr inbounds double, double* %8, i64 -1
%10 = bitcast double* %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds double*, double** %6, i64 -1
%12 = bitcast double** %11 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ sys_errmsg(char *);
__attribute__((unused)) void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (ptr == NULL && size != 0)
    sys_errmsg("out of memory");
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <xrealloc+0x43>
cmpq   $0x0,-0x10(%rbp)
je     1163 <xrealloc+0x43>
lea    0xea2(%rip),%rdi
call   1030 <sys_errmsg@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <xrealloc+0x25>
test   %r14,%r14
jne    1145 <xrealloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <sys_errmsg@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @sys_errmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
int MPI_Finalize(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @MPI_Finalize() {
ret i32 0
}

LLVM IR (-O2):
define i32 @MPI_Finalize() {
ret i32 0
}
/* Variables and functions */
int ret4();
int ret8();
int sum() { return ret8() + ret4(); }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ret8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ret4@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
push   %rbx
xor    %eax,%eax
call   1040 <ret8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <ret4@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sum() {
%1 = call i32 (...) @ret8()
%2 = call i32 (...) @ret4()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @sum() {
%1 = tail call i32 (...) @ret8()
%2 = tail call i32 (...) @ret4()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float m;
  printf("Metro Cúbico: ");
  scanf("%f", &m);
  printf("Litro: %.2f", 1000 * m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeab(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeb2(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Metro C\C3\BAbico: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Litro: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fmul float 1.000000e+03, %5
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Metro C\C3\BAbico: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Litro: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 1.000000e+03
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ valid(int);
int main() {
  int n;
  scanf("%d", &n);
  printf(valid(n) ? "makes sense\n" : "something is fishy\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <valid@plt>
mov    %rax,%rcx
lea    0xeaf(%rip),%rdi
lea    0xe9b(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <valid@plt>
test   %rax,%rax
lea    0xebb(%rip),%rax
lea    0xea7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"makes sense\0A\00"
@.str.2 = [20 x i8] c"something is fishy\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i64 @valid(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"makes sense\0A\00"
@.str.2 = [20 x i8] c"something is fishy\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @valid(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
void __bch_check_keys(struct btree *b, const char *fmt, ...) {}


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

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

LLVM IR (-O0):
%struct.btree = type opaque
define void @__bch_check_keys(%struct.btree* %0, i8* %1, ...) {
%3 = alloca %struct.btree*
%4 = alloca i8*
store %struct.btree* %0, %struct.btree** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.btree = type opaque
define void @__bch_check_keys(%struct.btree* nocapture %0, i8* nocapture %1, ...) {
ret void
}
void ff_hevc_put_hevc_pel_pixels6_8_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void vwarn(const char *fmt, va_list args) { vprintf(fmt, args); }


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

x86 assembly (clang, -O2):
<vwarn>:
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define void @vwarn(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 = call i32 @vprintf(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @vwarn(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret void
}
void __libc_csu_init(int argc, char **argv, char **envp) {}


x86 assembly (clang, -O0):
<__libc_csu_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__libc_csu_init(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
ret void
}

LLVM IR (-O2):
define void @__libc_csu_init(i32 %0, i8** nocapture %1, i8** nocapture %2) {
ret void
}
/* Variables and functions */
unsigned int strlen(const char *s) {
  const char *p = s;
  while (*p != '\0')
    p++;
  return (unsigned int)(p - s);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
float track_angle(int ch, int i) {}


x86 assembly (clang, -O0):
<track_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @track_angle(i32 %0, i32 %1) {
ret float undef
}
/* Variables and functions */
int _getReg(int);
int /*<<< orphan*/ _setReg(int, int);
int /*<<< orphan*/ getAcm(int);
void adxlINT() {
  _setReg(0x2D, 0x00);
  _setReg(0x2C, 0b00011000);
  while (_getReg(0x30) & 0b11111101) {
    getAcm(0);
    getAcm(1);
    getAcm(2);
  }
  _setReg(0x2E, 0b01000000);
  _setReg(0x2D, 0b00001000);
}


x86 assembly (clang, -O0):
<adxlINT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
xor    %esi,%esi
call   1040 <_setReg@plt>
mov    $0x2c,%edi
mov    $0x18,%esi
call   1040 <_setReg@plt>
mov    $0x30,%edi
call   1050 <_getReg@plt>
and    $0xfd,%eax
cmp    $0x0,%eax
je     1187 <adxlINT+0x57>
xor    %edi,%edi
call   1030 <getAcm@plt>
mov    $0x1,%edi
call   1030 <getAcm@plt>
mov    $0x2,%edi
call   1030 <getAcm@plt>
jmp    114f <adxlINT+0x1f>
mov    $0x2e,%edi
mov    $0x40,%esi
call   1040 <_setReg@plt>
mov    $0x2d,%edi
mov    $0x8,%esi
call   1040 <_setReg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adxlINT>:
push   %rax
mov    $0x2d,%edi
xor    %esi,%esi
call   1040 <_setReg@plt>
mov    $0x2c,%edi
mov    $0x18,%esi
call   1040 <_setReg@plt>
nopl   0x0(%rax)
mov    $0x30,%edi
call   1050 <_getReg@plt>
test   $0xfd,%al
je     117b <adxlINT+0x4b>
xor    %edi,%edi
call   1030 <getAcm@plt>
mov    $0x1,%edi
call   1030 <getAcm@plt>
mov    $0x2,%edi
call   1030 <getAcm@plt>
jmp    1150 <adxlINT+0x20>
mov    $0x2e,%edi
mov    $0x40,%esi
call   1040 <_setReg@plt>
mov    $0x2d,%edi
mov    $0x8,%esi
pop    %rax
jmp    1040 <_setReg@plt>

LLVM IR (-O0):
define void @adxlINT() {
%1 = call i32 @_setReg(i32 45, i32 0)
%2 = call i32 @_setReg(i32 44, i32 24)
br label %3
3: ; preds = %7, %0
%4 = call i32 @_getReg(i32 48)
%5 = and i32 %4, 253
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = call i32 @getAcm(i32 0)
%9 = call i32 @getAcm(i32 1)
%10 = call i32 @getAcm(i32 2)
br label %3
11: ; preds = %3
%12 = call i32 @_setReg(i32 46, i32 64)
%13 = call i32 @_setReg(i32 45, i32 8)
ret void
}

LLVM IR (-O2):
define void @adxlINT() {
%1 = tail call i32 @_setReg(i32 45, i32 0)
%2 = tail call i32 @_setReg(i32 44, i32 24)
%3 = tail call i32 @_getReg(i32 48)
%4 = and i32 %3, 253
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = tail call i32 @getAcm(i32 0)
%8 = tail call i32 @getAcm(i32 1)
%9 = tail call i32 @getAcm(i32 2)
%10 = tail call i32 @_getReg(i32 48)
%11 = and i32 %10, 253
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %0
%14 = tail call i32 @_setReg(i32 46, i32 64)
%15 = tail call i32 @_setReg(i32 45, i32 8)
ret void
}
int nonzero(void *a, unsigned long n) {
  char *p = a;
  char *e = a + n;
  for (; p < e; p++)
    if (*p)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    115d <nonzero+0x5d>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <nonzero+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1164 <nonzero+0x64>
jmp    114c <nonzero+0x4c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1120 <nonzero+0x20>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonzero>:
lea    (%rdi,%rsi,1),%rcx
xor    %eax,%eax
cmp    %rdi,%rcx
jbe    1127 <nonzero+0x27>
xor    %eax,%eax
nopl   (%rax)
cmpb   $0x0,(%rdi,%rax,1)
jne    1122 <nonzero+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <nonzero+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nonzero(i8* %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 %1
%4 = icmp ugt i8* %3, %0
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i8* %11, %3
br i1 %6, label %12, label %7
7: ; preds = %2, %5
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %10, label %5, label %12
12: ; preds = %7, %5, %2
%13 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %7 ]
ret i32 %13
}
OP(ed, d0) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void local_irq_restore(unsigned long flags) {}


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

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

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

LLVM IR (-O2):
define void @local_irq_restore(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int rtp_depayload(char *data, int len) {
  memmove(data, data + 12, (len - 12));
  return (len - 12);
}


x86 assembly (clang, -O0):
<rtp_depayload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xc,%rsi
mov    -0xc(%rbp),%edx
sub    $0xc,%edx
call   1030 <memmove@plt>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_depayload>:
push   %rbx
lea    0xc(%rdi),%rax
lea    -0xc(%rsi),%ebx
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <memmove@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rtp_depayload(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 i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 12
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 12
%10 = call i32 @memmove(i8* %5, i8* %7, i32 %9)
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 12
ret i32 %12
}

LLVM IR (-O2):
define i32 @rtp_depayload(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 12
%4 = add nsw i32 %1, -12
%5 = tail call i32 @memmove(i8* %0, i8* %3, i32 %4)
ret i32 %4
}
/* Variables and functions */
void *get_previous_free_block(void *ptr) {
  char *p = ptr;
  void **previous_block_info;
  p += (sizeof(size_t));
  previous_block_info = (void **)p;
  return *previous_block_info;
}


x86 assembly (clang, -O0):
<get_previous_free_block>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_previous_free_block>:
mov    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @get_previous_free_block(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 8
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %4
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
ret i8* %11
}

LLVM IR (-O2):
define i8* @get_previous_free_block(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_init1(void) {
  printf("main_init1"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"main_init1\00"
define void @main_init1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int cmp(char *s1, char *s2) {
  while (*s1 == *s2++)
    if (*s1++ == 0)
      return (0);
  return (*s1 - *(s2 - 1));
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <cmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <cmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116d <cmp+0x6d>
jmp    110c <cmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <cmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <cmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = sext i8 %6 to i32
%15 = sext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int foo(int, int);
int main() { return foo(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void Output_putchar(char c) { putchar(c); }


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

x86 assembly (clang, -O2):
<Output_putchar>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @Output_putchar(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
int test10(int x) { return x / -10 > 0; }


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
xor    %eax,%eax
cmp    $0xfffffff7,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @test10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test10(i32 %0) {
%2 = icmp slt i32 %0, -9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sp(char *seq, int i) {
  char c;
  c = seq[i];
  seq[i] = 0;
  printf("%s ", seq);
  seq[i] = c;
}


x86 assembly (clang, -O0):
<sp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
movslq %esi,%r14
mov    (%rdi,%r14,1),%bpl
movb   $0x0,(%rdi,%r14,1)
lea    0xed6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %bpl,(%rbx,%r14,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
define void @sp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8, i8* %5
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @sp(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
store i8 0, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
store i8 %5, i8* %4
ret void
}
double One(x)
double x;
{ return (1.0); }


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

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

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

LLVM IR (-O2):
define double @One(double %0) {
ret double 1.000000e+00
}
void max_num(int a, int b, int *wyjscie) {
  if (a > b) {
    *wyjscie = a;
  } else {
    *wyjscie = b;
  }
}


x86 assembly (clang, -O0):
<max_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1128 <max_num+0x28>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1131 <max_num+0x31>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_num>:
cmp    %esi,%edi
cmovg  %edi,%esi
mov    %esi,(%rdx)
ret

LLVM IR (-O0):
define void @max_num(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 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32*, i32** %6
store i32 %11, i32* %12
br label %16
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32*, i32** %6
store i32 %14, i32* %15
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @max_num(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
store i32 %5, i32* %2
ret void
}
int virtual_machine_resource_pool_plain_lack(void *pool_ptr) {
  (void)(pool_ptr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @virtual_machine_resource_pool_plain_lack(i8* nocapture readnone %0) {
ret i32 0
}
unsigned PtrFunc(int (*Func)(int), int X) { return Func(X); }


x86 assembly (clang, -O0):
<PtrFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PtrFunc>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @PtrFunc(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}