xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ set_value_at(int, int, int);
void add_platform(int x, int y, int length) {
  int i;
  for (i = x; i < x + length; i++)
    set_value_at(i, y, 1);
}


x86 assembly (clang, -O0):
<add_platform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1156 <add_platform+0x46>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <set_value_at@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <add_platform+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_platform>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1146 <add_platform+0x36>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
add    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14d,%esi
mov    $0x1,%edx
call   1030 <set_value_at@plt>
add    $0x1,%ebp
cmp    %ebx,%ebp
jl     1130 <add_platform+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @add_platform(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %0
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %0, %3 ]
%8 = tail call i32 @set_value_at(i32 %7, i32 %1, i32 1)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %4
br i1 %10, label %6, label %11
11: ; preds = %6, %3
ret void
}
void handle_LWP(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_LWP(i32 %0) {
ret void
}
void bcm43xx_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bcm43xx_debugfs_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int menu();
int /*<<< orphan*/ startFxn();
void main() {
  while (1) {
    switch (menu()) {
    case 2:
      exit(0);
    case 1:
      startFxn();
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    113d <main+0xd>
xor    %eax,%eax
call   1030 <menu@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
sub    $0x1,%eax
je     116f <main+0x3f>
jmp    1157 <main+0x27>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
jne    1176 <main+0x46>
jmp    1168 <main+0x38>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1040 <startFxn@plt>
jmp    113d <main+0xd>

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    1147 <main+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <startFxn@plt>
xor    %eax,%eax
call   1030 <menu@plt>
cmp    $0x1,%eax
je     1140 <main+0x10>
cmp    $0x2,%eax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %0, %7
%2 = call i32 (...) @menu()
switch i32 %2, label %7 [
i32 2, label %3
i32 1, label %5
]
3: ; preds = %1
%4 = call i32 @exit(i32 0)
unreachable
5: ; preds = %1
%6 = call i32 (...) @startFxn()
br label %7
7: ; preds = %5, %1
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %7, %0
%2 = tail call i32 (...) @menu()
switch i32 %2, label %7 [
i32 2, label %3
i32 1, label %5
]
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
%6 = tail call i32 (...) @startFxn()
br label %7
7: ; preds = %5, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ dump_error(char *);
scalar_t__ malloc(unsigned int);
unsigned long *ulvector(int nl, int nh) {
  unsigned long *v;
  v = (unsigned long *)malloc((unsigned)(nh - nl + 1) * sizeof(long));
  if (!v)
    dump_error("allocation failure in ulvector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<ulvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <ulvector+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <dump_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x8(,%rsi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <ulvector+0x27>
lea    0xebe(%rip),%rdi
call   1030 <dump_error@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"allocation failure in ulvector()\00"
define i64* @ulvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i64*
store i64* %14, i64** %5
%15 = load i64*, i64** %5
%16 = icmp ne i64* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @dump_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load i64*, i64** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds i64, i64* %20, i64 %23
ret i64* %24
}

LLVM IR (-O2):
@.str = [33 x i8] c"allocation failure in ulvector()\00"
define i64* @ulvector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 3
%5 = add i32 %4, 8
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @dump_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sext i32 %0 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds i64, i64* %11, i64 %13
ret i64* %14
}
_Ilong(dptr, length) double *dptr;
int length;
{
  char temp[75];
  int _Inodg();
  double x;
  double atof();
  if (_Isstr(temp, length, _Inodg) < 0)
    return (-1);
  x = atof(temp);
  if (dptr == 0)
    return (0);
  *dptr = x;
  return (1);
}


x86 assembly (clang, -O0):
<_Ilong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2ea3(%rip),%rdx
mov    $0x0,%al
call   1040 <_Isstr@plt>
cmp    $0x0,%eax
jge    1159 <_Ilong+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1194 <_Ilong+0x74>
lea    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1030 <atof@plt>
movsd  %xmm0,-0x68(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1180 <_Ilong+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1194 <_Ilong+0x74>
movsd  -0x68(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Ilong>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%r14
mov    0x2eaf(%rip),%rdx
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <_Isstr@plt>
test   %eax,%eax
js     115c <_Ilong+0x3c>
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <atof@plt>
test   %r14,%r14
je     1161 <_Ilong+0x41>
movsd  %xmm0,(%r14)
mov    $0x1,%ebx
jmp    1161 <_Ilong+0x41>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_Ilong(double* %0, i32 %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [75 x i8]
%7 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [75 x i8], [75 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* %5
%10 = call i32 (i8*, i32, i32 (...)*, ...) bitcast (i32 (...)* @_Isstr to i32 (i8*, i32, i32 (...)*, ...)*)(i8* %8, i32 %9, i32 (...)* @_Inodg)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %22
13: ; preds = %2
%14 = getelementptr inbounds [75 x i8], [75 x i8]* %6, i64 0, i64 0
%15 = call double (i8*, ...) bitcast (double (...)* @atof to double (i8*, ...)*)(i8* %14)
store double %15, double* %7
%16 = load double*, double** %4
%17 = icmp eq double* %16, null
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %3
br label %22
19: ; preds = %13
%20 = load double, double* %7
%21 = load double*, double** %4
store double %20, double* %21
store i32 1, i32* %3
br label %22
22: ; preds = %19, %18, %12
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @_Ilong(double* writeonly %0, i32 %1) {
%3 = alloca [75 x i8]
%4 = getelementptr inbounds [75 x i8], [75 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i32, i32 (...)*, ...) bitcast (i32 (...)* @_Isstr to i32 (i8*, i32, i32 (...)*, ...)*)(i8* %4, i32 %1, i32 (...)* @_Inodg)
%6 = icmp slt i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = call double (i8*, ...) bitcast (double (...)* @atof to double (i8*, ...)*)(i8* %4)
%9 = icmp eq double* %0, null
br i1 %9, label %11, label %10
10: ; preds = %7
store double %8, double* %0
br label %11
11: ; preds = %7, %2, %10
%12 = phi i32 [ 1, %10 ], [ -1, %2 ], [ 0, %7 ]
ret i32 %12
}
int config_READER_STREAMGUARD(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_READER_STREAMGUARD() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmove(unsigned int *, unsigned int *, int);
void umemmove(unsigned int *dest, unsigned int *src, int len) {
  memmove(dest, src, len * sizeof(unsigned int));
}


x86 assembly (clang, -O0):
<umemmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umemmove>:
shl    $0x2,%edx
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @umemmove(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 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memmove(i32* %7, i32* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @umemmove(i32* %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memmove(i32* %0, i32* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void h5(char *header) { printf("<h5>%s</h5>\n", header); }


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

x86 assembly (clang, -O2):
<h5>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"<h5>%s</h5>\0A\00"
define void @h5(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"<h5>%s</h5>\0A\00"
define void @h5(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, size_t);
int main() {
  int n = 0;
  int m = 1;
  size_t intsize;
  intsize = sizeof(int);
  printf("n = %d, m = %d, n and m has %u bytes; all ints have %u bytes.\n", n,
         m, sizeof n, intsize);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movq   $0x4,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
lea    0xeba(%rip),%rdi
mov    $0x4,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [63 x i8] c"n = %d, m = %d, n and m has %u bytes; all ints have %u bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i64 4, i64* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 4, i64 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"n = %d, m = %d, n and m has %u bytes; all ints have %u bytes.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 4, i64 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbmarch_clear_eoi(int f) { return ioctl(f, _IO(0xcb, 8)); }


x86 assembly (clang, -O0):
<cbmarch_clear_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0x8,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_clear_eoi>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0x8,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_clear_eoi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 203, i32 8)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbmarch_clear_eoi(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 8)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
int get_ds(void) {
  int r;
  asm volatile("mov %%ds, %0" : "=r"(r));
  return r;
}


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

x86 assembly (clang, -O2):
<get_ds>:
mov    %ds,%eax
ret

LLVM IR (-O0):
define i32 @get_ds() {
%1 = alloca i32
%2 = call i32 asm sideeffect "mov %ds, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_ds() {
%1 = tail call i32 asm sideeffect "mov %ds, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int terminal_print8(int, int, int /*<<< orphan*/ const *);
int terminal_print(int x, int y, const char *s) {
  return terminal_print8(x, y, (const int8_t *)s);
}


x86 assembly (clang, -O0):
<terminal_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <terminal_print8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_print>:
jmp    1030 <terminal_print8@plt>

LLVM IR (-O0):
define i32 @terminal_print(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 i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = call i32 @terminal_print8(i32 %7, i32 %8, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @terminal_print(i32 %0, i32 %1, i8* %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @terminal_print8(i32 %0, i32 %1, i32* %4)
ret i32 %5
}
/* Variables and functions */
unsigned long VIM_USER_SeekFile(void *, unsigned long);
unsigned long Avi_SeekFile(void *pFile_Ptr, unsigned long dOffset) {
  return VIM_USER_SeekFile(pFile_Ptr, dOffset);
}


x86 assembly (clang, -O0):
<Avi_SeekFile>:
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   1030 <VIM_USER_SeekFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Avi_SeekFile>:
jmp    1030 <VIM_USER_SeekFile@plt>

LLVM IR (-O0):
define i64 @Avi_SeekFile(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 i64 @VIM_USER_SeekFile(i8* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @Avi_SeekFile(i8* %0, i64 %1) {
%3 = tail call i64 @VIM_USER_SeekFile(i8* %0, i64 %1)
ret i64 %3
}
/* Type definitions */
struct Trie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ logger_impl(int, char *, int, char *);
int add_trie(struct Trie *root, char c) {
  {
    logger_impl(
        0x08,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c",
        35, "NotImplementedError\n");
  };
  return 0;
}


x86 assembly (clang, -O0):
<add_trie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x8,%edi
lea    0xed2(%rip),%rsi
mov    $0x23,%edx
lea    0xf48(%rip),%rcx
call   1030 <logger_impl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_trie>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xf63(%rip),%rcx
mov    $0x8,%edi
mov    $0x23,%edx
call   1030 <logger_impl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Trie = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c\00"
@.str.1 = [21 x i8] c"NotImplementedError\0A\00"
define i32 @add_trie(%struct.Trie* %0, i8 signext %1) {
%3 = alloca %struct.Trie*
%4 = alloca i8
store %struct.Trie* %0, %struct.Trie** %3
store i8 %1, i8* %4
%5 = call i32 @logger_impl(i32 8, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.Trie = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c\00"
@.str.1 = [21 x i8] c"NotImplementedError\0A\00"
define i32 @add_trie(%struct.Trie* nocapture readnone %0, i8 signext %1) {
%3 = tail call i32 @logger_impl(i32 8, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int iscright(char c) { return ')' == c; }


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

x86 assembly (clang, -O2):
<iscright>:
xor    %eax,%eax
cmp    $0x29,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @iscright(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 41, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @iscright(i8 signext %0) {
%2 = icmp eq i8 %0, 41
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t aap_full_write(int fd, const void *buf, size_t count) {
  return write(fd, buf, count);
}


x86 assembly (clang, -O0):
<aap_full_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aap_full_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @aap_full_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
unsigned FingerprintCat(unsigned a, unsigned b) {
  return a * 6037 + ((b * 17) ^ (b >> 16));
}


x86 assembly (clang, -O0):
<FingerprintCat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x1795,-0x4(%rbp),%eax
imul   $0x11,-0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
shr    $0x10,%edx
xor    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FingerprintCat>:
imul   $0x1795,%edi,%ecx
mov    %esi,%eax
shl    $0x4,%eax
add    %esi,%eax
shr    $0x10,%esi
xor    %esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @FingerprintCat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = mul i32 %5, 6037
%7 = load i32, i32* %4
%8 = mul i32 %7, 17
%9 = load i32, i32* %4
%10 = lshr i32 %9, 16
%11 = xor i32 %8, %10
%12 = add i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @FingerprintCat(i32 %0, i32 %1) {
%3 = mul i32 %0, 6037
%4 = mul i32 %1, 17
%5 = lshr i32 %1, 16
%6 = xor i32 %4, %5
%7 = add i32 %6, %3
ret i32 %7
}
/* Type definitions */
struct td_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __td_list_splice(struct td_list_head *,
                                    struct td_list_head *);
int /*<<< orphan*/ td_list_empty(struct td_list_head *);
void td_list_splice(struct td_list_head *list, struct td_list_head *head) {
  if (!td_list_empty(list))
    __td_list_splice(list, head);
}


x86 assembly (clang, -O0):
<td_list_splice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <td_list_empty@plt>
cmp    $0x0,%eax
jne    114f <td_list_splice+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__td_list_splice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_list_splice>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <td_list_empty@plt>
test   %eax,%eax
je     113b <td_list_splice+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__td_list_splice@plt>

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

LLVM IR (-O2):
%struct.td_list_head = type { i32 }
define void @td_list_splice(%struct.td_list_head* %0, %struct.td_list_head* %1) {
%3 = tail call i32 @td_list_empty(%struct.td_list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @__td_list_splice(%struct.td_list_head* %0, %struct.td_list_head* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ new_line();
void cmd_new_line(const char *pf, char **args) { new_line(); }


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

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

LLVM IR (-O0):
define void @cmd_new_line(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 (...) @new_line()
ret void
}

LLVM IR (-O2):
define void @cmd_new_line(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @new_line()
ret void
}
int labelset_is_empty(const unsigned char *labelset,
                      const unsigned long labelset_len) {
  if (labelset_len != 3)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<labelset_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
je     1123 <labelset_is_empty+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112a <labelset_is_empty+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labelset_is_empty>:
xor    %eax,%eax
cmp    $0x3,%rsi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @labelset_is_empty(i8* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ luaL_nonnullarg(int);
int /*<<< orphan*/ lua_pushobject(int /*<<< orphan*/);
int /*<<< orphan*/ lua_rawgettable();
void luaB_rawgettable(void) {
  lua_pushobject(luaL_nonnullarg(1));
  lua_pushobject(luaL_nonnullarg(2));
  lua_pushobject(lua_rawgettable());
}


x86 assembly (clang, -O0):
<luaB_rawgettable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x2,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x0,%al
call   1030 <lua_rawgettable@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaB_rawgettable>:
push   %rax
mov    $0x1,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x2,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
xor    %eax,%eax
call   1030 <lua_rawgettable@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushobject@plt>

LLVM IR (-O0):
define void @luaB_rawgettable() {
%1 = call i32 @luaL_nonnullarg(i32 1)
%2 = call i32 @lua_pushobject(i32 %1)
%3 = call i32 @luaL_nonnullarg(i32 2)
%4 = call i32 @lua_pushobject(i32 %3)
%5 = call i32 (...) @lua_rawgettable()
%6 = call i32 @lua_pushobject(i32 %5)
ret void
}

LLVM IR (-O2):
define void @luaB_rawgettable() {
%1 = tail call i32 @luaL_nonnullarg(i32 1)
%2 = tail call i32 @lua_pushobject(i32 %1)
%3 = tail call i32 @luaL_nonnullarg(i32 2)
%4 = tail call i32 @lua_pushobject(i32 %3)
%5 = tail call i32 (...) @lua_rawgettable()
%6 = tail call i32 @lua_pushobject(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fooA(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x;
  printf("The address of x is %p\n", &x);
  fooA(&x);
  printf("The value of x is %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <fooA@plt>
mov    -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
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),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <fooA@plt>
mov    0xc(%rsp),%esi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The address of x is %p\0A\00"
@.str.1 = [22 x i8] c"The value of x is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = call i32 @fooA(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The address of x is %p\0A\00"
@.str.1 = [22 x i8] c"The value of x is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @fooA(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
char *strtok(char *, char *);
char *split(char *delimiter, char *string) { return strtok(delimiter, string); }


x86 assembly (clang, -O0):
<split>:
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   1030 <strtok@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split>:
jmp    1030 <strtok@plt>

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

LLVM IR (-O2):
define i8* @split(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok(i8* %0, i8* %1)
ret i8* %3
}
int pdivisor_sum(int n) {
  int sum = 1;
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      sum += i + n / i;
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<pdivisor_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1162 <pdivisor_sum+0x62>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114f <pdivisor_sum+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <pdivisor_sum+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <pdivisor_sum+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdivisor_sum>:
mov    $0x1,%eax
cmp    $0x4,%edi
jl     113c <pdivisor_sum+0x3c>
mov    $0x1,%esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %ecx
add    %esi,%eax
add    %ecx,%eax
test   %edx,%edx
cmovne %esi,%eax
add    $0x1,%ecx
mov    %ecx,%edx
imul   %ecx,%edx
mov    %eax,%esi
cmp    %edi,%edx
jle    1120 <pdivisor_sum+0x20>
ret

LLVM IR (-O0):
define i32 @pdivisor_sum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %5
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = load i32, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = sdiv i32 %18, %19
%21 = add nsw i32 %17, %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
store i32 %23, i32* %3
br label %24
24: ; preds = %16, %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %5
28: ; preds = %5
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @pdivisor_sum(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = phi i32 [ 1, %1 ], [ %13, %5 ]
ret i32 %4
5: ; preds = %1, %5
%6 = phi i32 [ %14, %5 ], [ 2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 1, %1 ]
%8 = srem i32 %0, %6
%9 = sdiv i32 %0, %6
%10 = icmp eq i32 %8, 0
%11 = add i32 %6, %7
%12 = add i32 %11, %9
%13 = select i1 %10, i32 %12, i32 %7
%14 = add nuw nsw i32 %6, 1
%15 = mul nsw i32 %14, %14
%16 = icmp sgt i32 %15, %0
br i1 %16, label %3, label %5
}
void ff_hevc_put_hevc_uni_w_epel_h4_12_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ FALSE;
bool_t authnone_refresh(AUTH *x) {
  (void)x;
  return (FALSE);
}


x86 assembly (clang, -O0):
<authnone_refresh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<authnone_refresh>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @authnone_refresh(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @FALSE
ret i32 %4
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @authnone_refresh(i32* nocapture readnone %0) {
%2 = load i32, i32* @FALSE
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello\c, world\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"helloc, world\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"helloc, world\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
}
/* Variables and functions */
int five();
int four();
int one();
int three();
int two();
subtr() { return (-one() - two() - three() - four() - five()); }


x86 assembly (clang, -O0):
<subtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <one@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <two@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1070 <three@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <four@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <five@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtr>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <one@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <two@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1070 <three@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1050 <four@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <five@plt>
add    %ebp,%eax
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @subtr() {
%1 = call i32 (...) @one()
%2 = sub nsw i32 0, %1
%3 = call i32 (...) @two()
%4 = sub nsw i32 %2, %3
%5 = call i32 (...) @three()
%6 = sub nsw i32 %4, %5
%7 = call i32 (...) @four()
%8 = sub nsw i32 %6, %7
%9 = call i32 (...) @five()
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @subtr() {
%1 = tail call i32 (...) @one()
%2 = tail call i32 (...) @two()
%3 = add i32 %1, %2
%4 = tail call i32 (...) @three()
%5 = add i32 %3, %4
%6 = tail call i32 (...) @four()
%7 = add i32 %5, %6
%8 = tail call i32 (...) @five()
%9 = add i32 %7, %8
%10 = sub i32 0, %9
ret i32 %10
}
unsigned int perfctr_cstatus_has_ictrs(unsigned int cstatus) {
  return cstatus & (0x7F << 16);
}


x86 assembly (clang, -O0):
<perfctr_cstatus_has_ictrs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f0000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfctr_cstatus_has_ictrs>:
mov    %edi,%eax
and    $0x7f0000,%eax
ret

LLVM IR (-O0):
define i32 @perfctr_cstatus_has_ictrs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8323072
ret i32 %4
}

LLVM IR (-O2):
define i32 @perfctr_cstatus_has_ictrs(i32 %0) {
%2 = and i32 %0, 8323072
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ servoSetHigh(int);
void servoHighHold() { servoSetHigh((233)); }


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

x86 assembly (clang, -O2):
<servoHighHold>:
mov    $0xe9,%edi
jmp    1030 <servoSetHigh@plt>

LLVM IR (-O0):
define void @servoHighHold() {
%1 = call i32 @servoSetHigh(i32 233)
ret void
}

LLVM IR (-O2):
define void @servoHighHold() {
%1 = tail call i32 @servoSetHigh(i32 233)
ret void
}
/* Type definitions */
struct timeb {
  int dummy;
};

/* Variables and functions */
long ms_elapsed(struct timeb);
int /*<<< orphan*/ printf(char *, long, double);
void print_timer_elapsed(struct timeb before, size_t item_count) {
  long ms = ms_elapsed(before);
  double ns_per_item = ms * 1e6 / item_count;
  printf("%lims elapsed (%4.2fns per item).", ms, ns_per_item);
}


x86 assembly (clang, -O0):
<print_timer_elapsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ms_elapsed@plt>
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movaps 0xebc(%rip),%xmm2
movq   -0x10(%rbp),%xmm1
punpckldq %xmm2,%xmm1
movapd 0xebb(%rip),%xmm2
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timer_elapsed>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ms_elapsed@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xeca(%rip),%xmm0
movq   %rbx,%xmm1
punpckldq 0xecd(%rip),%xmm1
subpd  0xed5(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
lea    0xece(%rip),%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.timeb = type { i32 }
@.str = [34 x i8] c"%lims elapsed (%4.2fns per item).\00"
define void @print_timer_elapsed(i32 %0, i64 %1) {
%3 = alloca %struct.timeb
%4 = alloca i64
%5 = alloca i64
%6 = alloca double
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %3, i32 0, i32 0
store i32 %0, i32* %7
store i64 %1, i64* %4
%8 = getelementptr inbounds %struct.timeb, %struct.timeb* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @ms_elapsed(i32 %9)
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = sitofp i64 %11 to double
%13 = fmul double %12, 1.000000e+06
%14 = load i64, i64* %4
%15 = uitofp i64 %14 to double
%16 = fdiv double %13, %15
store double %16, double* %6
%17 = load i64, i64* %5
%18 = load double, double* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %17, double %18)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"%lims elapsed (%4.2fns per item).\00"
define void @print_timer_elapsed(i32 %0, i64 %1) {
%3 = tail call i64 @ms_elapsed(i32 %0)
%4 = sitofp i64 %3 to double
%5 = fmul double %4, 1.000000e+06
%6 = uitofp i64 %1 to double
%7 = fdiv double %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %3, double %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testByte();
int /*<<< orphan*/ testInt();
int /*<<< orphan*/ testLong();
int /*<<< orphan*/ testPointer();
int /*<<< orphan*/ testShort();
int main() {
  testLong();
  testInt();
  testShort();
  testByte();
  testPointer();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <testLong@plt>
mov    $0x0,%al
call   1050 <testInt@plt>
mov    $0x0,%al
call   1060 <testShort@plt>
mov    $0x0,%al
call   1070 <testByte@plt>
mov    $0x0,%al
call   1030 <testPointer@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <testLong@plt>
xor    %eax,%eax
call   1050 <testInt@plt>
xor    %eax,%eax
call   1060 <testShort@plt>
xor    %eax,%eax
call   1070 <testByte@plt>
xor    %eax,%eax
call   1030 <testPointer@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @testLong()
%2 = call i32 (...) @testInt()
%3 = call i32 (...) @testShort()
%4 = call i32 (...) @testByte()
%5 = call i32 (...) @testPointer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testLong()
%2 = tail call i32 (...) @testInt()
%3 = tail call i32 (...) @testShort()
%4 = tail call i32 (...) @testByte()
%5 = tail call i32 (...) @testPointer()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpu_monitor_start();
int main(int argc, char **argv) {
  cpu_monitor_start();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <cpu_monitor_start@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @cpu_monitor_start()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cpu_monitor_start()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xca() {
  Assert_real((isalpha(202) == 0),
              "/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_isalpha.c",
              1015, ("isalpha should be 0 for 0xca"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xca>:
push   %rbp
mov    %rsp,%rbp
mov    $0xca,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3f7,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xca>:
push   %rax
mov    $0xca,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3f7,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xca\00"
define void @t_isalpha_0xca() {
%1 = call i64 @isalpha(i32 202)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1015, i8* getelementptr inbounds ([29 x i8], [29 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xca\00"
define void @t_isalpha_0xca() {
%1 = tail call i64 @isalpha(i32 202)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1015, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_C2uint8_reg(unsigned char val) {
  return ((val) & (0xC2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C2uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xc2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_C2uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 194
%6 = icmp ne i32 %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_C2uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -62
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double pnorm5(double, double, double, int, int /*<<< orphan*/);
double pnorm(double x) { return pnorm5(x, 0.0, 1.0, 1, 0); }


x86 assembly (clang, -O0):
<pnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
movsd  0xed3(%rip),%xmm2
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <pnorm5@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnorm>:
movsd  0xee8(%rip),%xmm2
xorps  %xmm1,%xmm1
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <pnorm5@plt>

LLVM IR (-O0):
define double @pnorm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pnorm5(double %3, double 0.000000e+00, double 1.000000e+00, i32 1, i32 0)
ret double %4
}

LLVM IR (-O2):
define double @pnorm(double %0) {
%2 = tail call double @pnorm5(double %0, double 0.000000e+00, double 1.000000e+00, i32 1, i32 0)
ret double %2
}
void XShapeQueryVersion() {}


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

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

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

LLVM IR (-O2):
define void @XShapeQueryVersion() {
ret void
}