xunge/DecIR huggingface dataset:
int copyHObject(char **object, long size) {
  char *origObject;
  char *newObject;
  origObject = *object;
  newObject = (char *)(memset(malloc((size) * (1)), 0, (size) * (1)));
  *object = newObject;
  if (!newObject)
    return (0);
  memcpy(newObject, origObject, size);
  return (1);
}


x86 assembly (clang, -O0):
<copyHObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rdi,-0x30(%rbp)
mov    -0x18(%rbp),%rdx
shl    $0x0,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x28(%rbp)
jne    1198 <copyHObject+0x68>
movl   $0x0,-0x4(%rbp)
jmp    11b0 <copyHObject+0x80>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyHObject>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1155 <copyHObject+0x35>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    $0x1,%eax
jmp    1157 <copyHObject+0x37>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @copyHObject(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
%9 = load i8*, i8** %8
store i8* %9, i8** %6
%10 = load i64, i64* %5
%11 = mul nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
%13 = load i64, i64* %5
%14 = mul nsw i64 %13, 1
store i8* %12, i8** %7
%15 = load i8*, i8** %7
%16 = load i8**, i8*** %4
store i8* %15, i8** %16
%17 = load i8*, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %20, label %19
19: ; preds = %2
store i32 0, i32* %3
br label %24
20: ; preds = %2
%21 = load i8*, i8** %7
%22 = load i8*, i8** %6
%23 = load i64, i64* %5
store i32 1, i32* %3
br label %24
24: ; preds = %20, %19
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @copyHObject(i8** nocapture %0, i64 %1) {
%3 = load i8*, i8** %0
%4 = call i8* @calloc(i64 1, i64 %1)
store i8* %4, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %3, i64 %1, i1 false)
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
double vlength(float *);
int /*<<< orphan*/ vscale(float *, double);
void vnormal(float *v) { vscale(v, 1.0 / vlength(v)); }


x86 assembly (clang, -O0):
<vnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vlength@plt>
mov    -0x10(%rbp),%rdi
movaps %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <vscale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnormal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vlength@plt>
movsd  0xecf(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    %rbx,%rdi
movapd %xmm1,%xmm0
pop    %rbx
jmp    1040 <vscale@plt>

LLVM IR (-O0):
define void @vnormal(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call double @vlength(float* %4)
%6 = fdiv double 1.000000e+00, %5
%7 = call i32 @vscale(float* %3, double %6)
ret void
}

LLVM IR (-O2):
define void @vnormal(float* %0) {
%2 = tail call double @vlength(float* %0)
%3 = fdiv double 1.000000e+00, %2
%4 = tail call i32 @vscale(float* %0, double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char n;
  scanf("%c", &n);
  n = 'z' - n;
  n = n + 'a';
  printf("%c", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
lea    0xea9(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0xf(%rsp),%al
mov    %al,0xf(%rsp)
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
store i8 %4, i8* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
unsigned long get_next_mem_node(int);
unsigned long get_first_mem_node(void) { return get_next_mem_node(-1); }


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

x86 assembly (clang, -O2):
<get_first_mem_node>:
mov    $0xffffffff,%edi
jmp    1030 <get_next_mem_node@plt>

LLVM IR (-O0):
define i64 @get_first_mem_node() {
%1 = call i64 @get_next_mem_node(i32 -1)
ret i64 %1
}

LLVM IR (-O2):
define i64 @get_first_mem_node() {
%1 = tail call i64 @get_next_mem_node(i32 -1)
ret i64 %1
}
/* Variables and functions */
void *_memset(void *, int, int);
void *memset(void *p, int c, int size) { return _memset(p, c, size); }


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

x86 assembly (clang, -O2):
<memset>:
jmp    1030 <_memset@plt>

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

LLVM IR (-O2):
define i8* @memset(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @_memset(i8* %0, i32 %1, i32 %2)
ret i8* %4
}
void gtk_notebook_get_show_tabs() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_get_show_tabs() {
ret void
}
int fromxdigit(int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  if (c >= 'a' && c <= 'f')
    return c - 'a' + 10;
  if (c >= 'A' && c <= 'F')
    return c - 'A' + 10;
  return 0;
}


x86 assembly (clang, -O0):
<fromxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <fromxdigit+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <fromxdigit+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <fromxdigit+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <fromxdigit+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <fromxdigit+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <fromxdigit+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <fromxdigit+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <fromxdigit+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <fromxdigit+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1124 <fromxdigit+0x24>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <fromxdigit+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%ecx
add    $0xffffffc9,%edi
xor    %eax,%eax
cmp    $0x6,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @fromxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 0, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @fromxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 0
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int);
void echoline(FILE *fp) {
  int ch;
  while ((ch = fgetc(fp)) != EOF) {
    (void)putchar(ch);
    if (ch == '\n')
      break;
  }
}


x86 assembly (clang, -O0):
<echoline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%eax
je     1163 <echoline+0x43>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0xa,-0xc(%rbp)
jne    115e <echoline+0x3e>
jmp    1163 <echoline+0x43>
jmp    112c <echoline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoline>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eba(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    (%r14),%eax
je     114b <echoline+0x2b>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    $0xa,%ebp
jne    1130 <echoline+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @echoline(i32* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @putchar(i32 %3)
%8 = icmp eq i32 %3, 10
br i1 %8, label %9, label %2
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(int);
scalar_t__ isupper(int);
int toupper(int c) { return (!isalpha(c) || isupper(c)) ? c : (c - 32); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
je     114e <toupper+0x2e>
mov    -0x4(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1159 <toupper+0x39>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <toupper+0x42>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %eax,%eax
je     113e <toupper+0x1e>
mov    %ebx,%edi
call   1040 <isupper@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmovne %ebx,%ecx
mov    %ecx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isalpha(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isupper(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6, %1
%11 = load i32, i32* %2
br label %15
12: ; preds = %6
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 32
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ %11, %10 ], [ %14, %12 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @isupper(i32 %0)
%6 = icmp eq i64 %5, 0
%7 = add nsw i32 %0, -32
%8 = select i1 %6, i32 %7, i32 %0
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ %0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ DATA_synapse();
int /*<<< orphan*/ LibraryHeader(char *, char *);
int /*<<< orphan*/ STARTUP_synapse();
LIBRARY_synapse() {
  LibraryHeader("synapse", "Sat Feb  1 10:41:06 2014 ");
  DATA_synapse();
  STARTUP_synapse();
}


x86 assembly (clang, -O0):
<LIBRARY_synapse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1040 <LibraryHeader@plt>
mov    $0x0,%al
call   1030 <DATA_synapse@plt>
mov    $0x0,%al
call   1050 <STARTUP_synapse@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBRARY_synapse>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <LibraryHeader@plt>
xor    %eax,%eax
call   1030 <DATA_synapse@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <STARTUP_synapse@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"synapse\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:06 2014 \00"
define i32 @LIBRARY_synapse() {
%1 = alloca i32
%2 = call i32 @LibraryHeader(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @DATA_synapse()
%4 = call i32 (...) @STARTUP_synapse()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [8 x i8] c"synapse\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:06 2014 \00"
define i32 @LIBRARY_synapse() {
%1 = tail call i32 @LibraryHeader(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @DATA_synapse()
%3 = tail call i32 (...) @STARTUP_synapse()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_mul(uintptr_t, uintptr_t, uintptr_t);
void fiat_p256_mul(uint64_t out1[4], const uint64_t arg1[4],
                   const uint64_t arg2[4]) {
  internal_fiat_p256_mul((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p256_mul>:
jmp    1030 <internal_fiat_p256_mul@plt>

LLVM IR (-O0):
define void @fiat_p256_mul(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p256_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p256_mul(i64 %4, i64 %5, i64 %6)
ret void
}
void(outw_local)(unsigned short value, int port) {
  {
    ;
    return;
  }
}


x86 assembly (clang, -O0):
<outw_local>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @outw_local(i16 zeroext %0, i32 %1) {
ret void
}
void main(void) {
  float x;
  int y;
  int w;
  x = w + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = sitofp i32 %6 to float
store float %7, float* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
scalar_t__ posix_memalign(void **, size_t, size_t);
void *aligned_malloc(size_t size, size_t align) {
  void *result;
  if (posix_memalign(&result, align, size))
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<aligned_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <posix_memalign@plt>
cmp    $0x0,%rax
je     1143 <aligned_malloc+0x33>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_malloc>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
test   %rax,%rax
jne    1127 <aligned_malloc+0x17>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @aligned_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @posix_memalign(i8** %3, i64 %1, i64 %0)
%6 = icmp eq i64 %5, 0
%7 = load i8*, i8** %3
%8 = select i1 %6, i8* %7, i8* null
ret i8* %8
}
int compare(const void *a, const void *b) {
  if (*(long long *)a < *(long long *)b)
    return -1;
  if (*(long long *)a == *(long long *)b)
    return 0;
  if (*(long long *)a > *(long long *)b)
    return 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jge    112c <compare+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <compare+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jne    114c <compare+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1167 <compare+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jle    1167 <compare+0x67>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
char *opf_packet(char *buf) { return buf + 1; }


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

x86 assembly (clang, -O2):
<opf_packet>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @opf_packet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %4
}

LLVM IR (-O2):
define i8* @opf_packet(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
void mspack_destroy_kwaj_compressor(struct mskwaj_compressor *this) {}


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

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

LLVM IR (-O0):
%struct.mskwaj_compressor = type opaque
define void @mspack_destroy_kwaj_compressor(%struct.mskwaj_compressor* %0) {
%2 = alloca %struct.mskwaj_compressor*
store %struct.mskwaj_compressor* %0, %struct.mskwaj_compressor** %2
ret void
}

LLVM IR (-O2):
%struct.mskwaj_compressor = type opaque
define void @mspack_destroy_kwaj_compressor(%struct.mskwaj_compressor* nocapture %0) {
ret void
}
int lineLenght(char *line) {
  int count = 0;
  while (line[count++] != '\0')
    ;
  return (count - 1);
}


x86 assembly (clang, -O0):
<lineLenght>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1133 <lineLenght+0x33>
jmp    110f <lineLenght+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lineLenght(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int paging_protection(int virtaddr, char flags) { return 1; }


x86 assembly (clang, -O0):
<paging_protection>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @paging_protection(i32 %0, i8 signext %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x49() {
  Assert_real((isprint(73)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              370, ("isprint should be 1 for I"));
}


x86 assembly (clang, -O0):
<t_isprint_0x49>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x172,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x49>:
push   %rax
mov    $0x49,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x172,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for I\00"
define void @t_isprint_0x49() {
%1 = call i32 @isprint(i32 73)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for I\00"
define void @t_isprint_0x49() {
%1 = tail call i32 @isprint(i32 73)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct blue_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct blue_object **);
void blue_array_destroy(struct blue_object **array) {
  if (array) {
    free(array);
  }
}


x86 assembly (clang, -O0):
<blue_array_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <blue_array_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.blue_object = type { i32 }
define void @blue_array_destroy(%struct.blue_object** %0) {
%2 = alloca %struct.blue_object**
store %struct.blue_object** %0, %struct.blue_object*** %2
%3 = load %struct.blue_object**, %struct.blue_object*** %2
%4 = icmp ne %struct.blue_object** %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.blue_object**, %struct.blue_object*** %2
%7 = call i32 @free(%struct.blue_object** %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.blue_object = type { i32 }
define void @blue_array_destroy(%struct.blue_object** %0) {
%2 = icmp eq %struct.blue_object** %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.blue_object** %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int comp_str(void *ref_data, void *new_data) {
  return strcmp(*(char **)ref_data, *(char **)new_data);
}


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

x86 assembly (clang, -O2):
<comp_str>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @comp_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ xs2tp(int);
void xs2tp_(int *panelid) { xs2tp(*panelid); }


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

x86 assembly (clang, -O2):
<xs2tp_>:
mov    (%rdi),%edi
jmp    1030 <xs2tp@plt>

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

LLVM IR (-O2):
define void @xs2tp_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @xs2tp(i32 %2)
ret void
}
int destructor(char *string) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @destructor(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int foo(char *x) { return strlen(x); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
int sumOfDigits(int num) {
  if (num == 1)
    return 1;
  if (num > 0) {
    return num % 10 + sumOfDigits(num / 10);
  } else
    return 0;
}


x86 assembly (clang, -O0):
<sumOfDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <sumOfDigits+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116f <sumOfDigits+0x5f>
cmpl   $0x0,-0x8(%rbp)
jle    1168 <sumOfDigits+0x58>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sumOfDigits@plt>
mov    -0xc(%rbp),%edx
add    %eax,%edx
mov    %edx,-0x4(%rbp)
jmp    116f <sumOfDigits+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOfDigits>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     114d <sumOfDigits+0x4d>
xor    %r8d,%r8d
mov    $0xcccccccd,%r9d
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
test   %edi,%edi
jle    114a <sumOfDigits+0x4a>
mov    %edi,%esi
imul   %r9,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %edi,%edx
sub    %ecx,%edx
add    %edx,%eax
add    $0xfffffff6,%edi
cmp    $0x9,%edi
mov    %esi,%edi
ja     1120 <sumOfDigits+0x20>
mov    $0x1,%r8d
add    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @sumOfDigits(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %9, %7 ], [ %0, %1 ]
%5 = phi i32 [ %10, %7 ], [ 0, %1 ]
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = urem i32 %4, 10
%9 = udiv i32 %4, 10
%10 = add nuw nsw i32 %8, %5
%11 = add nsw i32 %4, -10
%12 = icmp ult i32 %11, 10
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ %10, %7 ], [ %5, %3 ]
%15 = phi i32 [ 1, %7 ], [ 0, %3 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 1, %1 ]
ret i32 %18
}
int test_imm_13uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x13 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_13uint64_lowword_mem>:
testb  $0x13,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 19
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_93uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x93 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_93uint64_lowword_reg>:
test   $0x93,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_93uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 147
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_dl_free_numeric(void **);
void umf4fnum_(void **Numeric) { umfpack_dl_free_numeric(Numeric); }


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

x86 assembly (clang, -O2):
<umf4fnum_>:
jmp    1030 <umfpack_dl_free_numeric@plt>

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

LLVM IR (-O2):
define void @umf4fnum_(i8** %0) {
%2 = tail call i32 @umfpack_dl_free_numeric(i8** %0)
ret void
}
/* Variables and functions */
void free_bool(bool _val) { return; }


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

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

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

LLVM IR (-O2):
define void @free_bool(i32 %0) {
ret void
}
void intraprocdpd() {
  int *y;
  int *z;
  *y = 42;
  z = y;
}


x86 assembly (clang, -O0):
<intraprocdpd>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @intraprocdpd() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
store i32 42, i32* %3
%4 = load i32*, i32** %1
store i32* %4, i32** %2
ret void
}

LLVM IR (-O2):
unsigned long power(unsigned long y, unsigned long x) {
  unsigned long r = 1;
  while (x) {
    if (x & 1)
      r *= y;
    y *= y;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <power+0x5c>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     113e <power+0x3e>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <power+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %rsi,%rsi
je     1140 <power+0x40>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %rsi,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   $0x1,%sil
mov    %rdi,%rcx
cmove  %r8,%rcx
imul   %rcx,%rax
imul   %rdi,%rdi
shr    %rdx
cmp    $0x1,%rsi
mov    %rdx,%rsi
ja     1120 <power+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @power(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 1, %2 ]
%6 = phi i64 [ %13, %4 ], [ %1, %2 ]
%7 = phi i64 [ %12, %4 ], [ %0, %2 ]
%8 = and i64 %6, 1
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i64 1, i64 %7
%11 = mul i64 %10, %5
%12 = mul i64 %7, %7
%13 = lshr i64 %6, 1
%14 = icmp ult i64 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i64 [ 1, %2 ], [ %11, %4 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ inb(int);
void io_delay(void) { inb(0x80); }


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

x86 assembly (clang, -O2):
<io_delay>:
mov    $0x80,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define void @io_delay() {
%1 = call i32 @inb(i32 128)
ret void
}

LLVM IR (-O2):
define void @io_delay() {
%1 = tail call i32 @inb(i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  printf("Hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
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"Hello World\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = 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"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
int main(void) {
  f(22);
  g(42);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
call   1030 <f@plt>
mov    $0x2a,%edi
call   1040 <g@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x16,%edi
call   1030 <f@plt>
mov    $0x2a,%edi
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 22)
%2 = call i32 @g(i32 42)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 22)
%2 = tail call i32 @g(i32 42)
ret i32 0
}
int f1() {
  int a;
  a = 0;
}


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

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

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

LLVM IR (-O2):
define i32 @f1() {
ret i32 undef
}
/* Variables and functions */
void strcpy(char *buffer, char const *string) {
  while ((*buffer++ = *string++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <strcpy+0x3f>
jmp    110c <strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(int);
int /*<<< orphan*/ put8(int);
void jmp_imm(int saut) {
  put8(0xE9);
  put32(saut);
}


x86 assembly (clang, -O0):
<jmp_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xe9,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jmp_imm>:
push   %rbx
mov    %edi,%ebx
mov    $0xe9,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jmp_imm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 233)
%4 = load i32, i32* %2
%5 = call i32 @put32(i32 %4)
ret void
}

LLVM IR (-O2):
define void @jmp_imm(i32 %0) {
%2 = tail call i32 @put8(i32 233)
%3 = tail call i32 @put32(i32 %0)
ret void
}
int cairo_code_draw_casBLabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casBLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casBLabel_get_width() {
ret i32 7
}
/* Variables and functions */
int MAP_ANON;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/ *, int, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, int);
int test_munmap_sigsegv(void) {
  void *addr = mmap(((NULL)), ((0x4000)), (PROT_READ | PROT_WRITE),
                    MAP_ANON | MAP_PRIVATE, -1, 0);
  munmap(addr, 0x4000);
  int data = *((volatile int *)(addr + 0x2000));
  (void)data;
  return 1;
}


x86 assembly (clang, -O0):
<test_munmap_sigsegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    0x2ea0(%rip),%rax
or     (%rax),%edx
mov    0x2e8f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7e(%rip),%rax
or     (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x4000,%esi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4000,%esi
call   1040 <munmap@plt>
mov    -0x8(%rbp),%rax
mov    0x2000(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_munmap_sigsegv>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e96(%rip),%rax
mov    0x2e87(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %edi,%edi
mov    $0x4000,%esi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4000,%esi
call   1040 <munmap@plt>
mov    0x2000(%rbx),%eax
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_ANON = global i32 0
@MAP_PRIVATE = global i32 0
define i32 @test_munmap_sigsegv() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @PROT_WRITE
%5 = or i32 %3, %4
%6 = load i32, i32* @MAP_ANON
%7 = load i32, i32* @MAP_PRIVATE
%8 = or i32 %6, %7
%9 = call i8* @mmap(i32* null, i32 16384, i32 %5, i32 %8, i32 -1, i32 0)
store i8* %9, i8** %1
%10 = load i8*, i8** %1
%11 = call i32 @munmap(i8* %10, i32 16384)
%12 = load i8*, i8** %1
%13 = getelementptr i8, i8* %12, i64 8192
%14 = bitcast i8* %13 to i32*
%15 = load volatile i32, i32* %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
ret i32 1
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_ANON = global i32 0
@MAP_PRIVATE = global i32 0
define i32 @test_munmap_sigsegv() {
%1 = load i32, i32* @PROT_READ
%2 = load i32, i32* @PROT_WRITE
%3 = or i32 %2, %1
%4 = load i32, i32* @MAP_ANON
%5 = load i32, i32* @MAP_PRIVATE
%6 = or i32 %5, %4
%7 = tail call i8* @mmap(i32* null, i32 16384, i32 %3, i32 %6, i32 -1, i32 0)
%8 = tail call i32 @munmap(i8* %7, i32 16384)
%9 = getelementptr i8, i8* %7, i64 8192
%10 = bitcast i8* %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 1
}