xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  b = b & (1 << a);
  if (b >> a == 1) {
    printf("1");
  } else
    printf("0");
  printf("\n");
  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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
cmp    $0x1,%eax
jne    1179 <main+0x59>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1185 <main+0x65>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%cl
mov    $0x1,%eax
shl    %cl,%eax
and    (%rsp),%eax
mov    %eax,(%rsp)
sar    %cl,%eax
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
or     $0x30,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = shl nuw i32 1, %7
%9 = and i32 %8, %6
store i32 %9, i32* %2
%10 = ashr i32 %9, %7
%11 = icmp eq i32 %10, 1
%12 = select i1 %11, i32 49, i32 48
%13 = call i32 @putchar(i32 %12)
%14 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
int config_lineempty(const char *ln) {
  char *tmp = (char *)ln;
  while (*tmp != '\0') {
    if (!isspace(*tmp)) {
      return 0;
    }
    tmp++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<config_lineempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <config_lineempty+0x56>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1155 <config_lineempty+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116d <config_lineempty+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <config_lineempty+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_lineempty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <config_lineempty+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <config_lineempty+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <config_lineempty+0x20>
jmp    114b <config_lineempty+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @config_lineempty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
scalar_t__ has_colors();
int /*<<< orphan*/ inicializa_cores();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
extern void inicia_ncurses() {
  initscr();
  cbreak();
  if (has_colors()) {
    start_color();
    inicializa_cores();
  }
  noecho();
  curs_set(0);
}


x86 assembly (clang, -O0):
<inicia_ncurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   1030 <has_colors@plt>
cmp    $0x0,%rax
je     11a1 <inicia_ncurses+0x31>
mov    $0x0,%al
call   1060 <start_color@plt>
mov    $0x0,%al
call   1090 <inicializa_cores@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
xor    %edi,%edi
call   1080 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicia_ncurses>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   1030 <has_colors@plt>
test   %rax,%rax
je     1199 <inicia_ncurses+0x29>
xor    %eax,%eax
call   1060 <start_color@plt>
xor    %eax,%eax
call   1090 <inicializa_cores@plt>
xor    %eax,%eax
call   1070 <noecho@plt>
xor    %edi,%edi
pop    %rax
jmp    1080 <curs_set@plt>

LLVM IR (-O0):
define void @inicia_ncurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i64 (...) @has_colors()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 (...) @start_color()
%7 = call i32 (...) @inicializa_cores()
br label %8
8: ; preds = %5, %0
%9 = call i32 (...) @noecho()
%10 = call i32 @curs_set(i32 0)
ret void
}

LLVM IR (-O2):
define void @inicia_ncurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i64 (...) @has_colors()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 (...) @start_color()
%7 = tail call i32 (...) @inicializa_cores()
br label %8
8: ; preds = %5, %0
%9 = tail call i32 (...) @noecho()
%10 = tail call i32 @curs_set(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AccelGyroSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void AccelGyroSettingsLogging() { UAVObjLogging(AccelGyroSettingsHandle()); }


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

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

LLVM IR (-O0):
define void @AccelGyroSettingsLogging() {
%1 = call i32 (...) @AccelGyroSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelGyroSettingsLogging() {
%1 = tail call i32 (...) @AccelGyroSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int isprint(const char c) {
  if ((c >= ' ') && (c <= '~')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     1130 <isprint+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jg     1130 <isprint+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isprint+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isprint(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort_b0(char *);
unsigned int isHash(unsigned int i) {
  if (i < 0x10000000)
    abort_b0("Expected Token/Label");
  return (1);
}


x86 assembly (clang, -O0):
<isHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x10000000,-0x4(%rbp)
jae    1134 <isHash+0x24>
lea    0xed1(%rip),%rdi
call   1030 <abort_b0@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHash>:
cmp    $0xfffffff,%edi
ja     1129 <isHash+0x19>
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <abort_b0@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Expected Token/Label\00"
define i32 @isHash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 268435456
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @abort_b0(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"Expected Token/Label\00"
define i32 @isHash(i32 %0) {
%2 = icmp ult i32 %0, 268435456
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @abort_b0(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 1
}
/* Variables and functions */
double sqrt(double);
double norm_float(float *vec, int beg, int end) {
  double temp;
  double dot_float(float *vec1, int beg, int end, float *vec2);
  temp = sqrt(dot_float(vec, beg, end, vec));
  return (temp);
}


x86 assembly (clang, -O0):
<norm_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
mov    -0x8(%rbp),%rcx
call   1030 <dot_float@plt>
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm_float>:
push   %rax
mov    %rdi,%rcx
call   1030 <dot_float@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1139 <norm_float+0x19>
sqrtsd %xmm0,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @norm_float(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load float*, float** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load float*, float** %4
%12 = call double @dot_float(float* %8, i32 %9, i32 %10, float* %11)
%13 = call double @sqrt(double %12)
store double %13, double* %7
%14 = load double, double* %7
ret double %14
}

LLVM IR (-O2):
define double @norm_float(float* %0, i32 %1, i32 %2) {
%4 = tail call double @dot_float(float* %0, i32 %1, i32 %2, float* %0)
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
void uninitvar_fgetc(void) {
  FILE *fp;
  (void)fgetc(fp);
}


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

x86 assembly (clang, -O2):
<uninitvar_fgetc>:
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define void @uninitvar_fgetc() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @fgetc(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fgetc() {
%1 = tail call i32 @fgetc(i32* undef)
ret void
}
/* Variables and functions */
int l2(unsigned int);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, int);
const char *addr_map(unsigned int addr, unsigned int mask) {
  static char buf[100];
  sprintf(buf, "%2d, %2d", addr - 0xFFFB4200, l2(mask));
  return buf;
}


x86 assembly (clang, -O0):
<addr_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xfffb4200,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <l2@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0x2ef3(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ee0(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_map>:
push   %r14
push   %rbx
push   %rax
lea    0x4be00(%rdi),%ebx
mov    %esi,%edi
call   1030 <l2@plt>
lea    0x2f08(%rip),%r14
lea    0xec1(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@addr_map.buf = internal global [100 x i8] zeroinitializer
@.str = [9 x i8] c"%2d, %2d\00"
define i8* @addr_map(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 = sub i32 %5, -310784
%7 = load i32, i32* %4
%8 = call i32 @l2(i32 %7)
%9 = call i32 @sprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @addr_map.buf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @addr_map.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@addr_map.buf = internal global [100 x i8] zeroinitializer
@.str = [9 x i8] c"%2d, %2d\00"
define i8* @addr_map(i32 %0, i32 %1) {
%3 = add i32 %0, 310784
%4 = tail call i32 @l2(i32 %1)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @addr_map.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @addr_map.buf, i64 0, i64 0)
}
void ellfil_(mask, npix, nrast) float mask[];
int *npix, *nrast;
{ ellipse_fill(mask, *npix, *nrast); }


x86 assembly (clang, -O0):
<ellfil_>:
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),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <ellipse_fill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ellfil_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
xor    %eax,%eax
jmp    1030 <ellipse_fill@plt>

LLVM IR (-O0):
define void @ellfil_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @ellipse_fill to i32 (float*, i32, i32, ...)*)(float* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @ellfil_(float* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @ellipse_fill to i32 (float*, i32, i32, ...)*)(float* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void int_array_delete(int *p) {
  if (p) {
    free(p);
  }
}


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

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

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

LLVM IR (-O2):
define void @int_array_delete(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quatd_rotateAxis_new(double *, double, double const,
                                        double const, double const);
void quatd_rotateAxisVec_new(double quat[4], double degrees,
                             const double axis[3]) {
  quatd_rotateAxis_new(quat, degrees, axis[0], axis[1], axis[2]);
}


x86 assembly (clang, -O0):
<quatd_rotateAxisVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm3
call   1030 <quatd_rotateAxis_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quatd_rotateAxisVec_new>:
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
movsd  0x10(%rsi),%xmm3
jmp    1030 <quatd_rotateAxis_new@plt>

LLVM IR (-O0):
define void @quatd_rotateAxisVec_new(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double, double* %5
%9 = load double*, double** %6
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = call i32 @quatd_rotateAxis_new(double* %7, double %8, double %11, double %14, double %17)
ret void
}

LLVM IR (-O2):
define void @quatd_rotateAxisVec_new(double* %0, double %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = getelementptr inbounds double, double* %2, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %2, i64 2
%8 = load double, double* %7
%9 = tail call i32 @quatd_rotateAxis_new(double* %0, double %1, double %4, double %6, double %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ULLONG_MAX;
long long parse_ull_bounds(char const *, int /*<<< orphan*/, int /*<<< orphan*/,
                           int *);
long long parse_ull(const char *sval, int *out_status) {
  return parse_ull_bounds(sval, 0, ULLONG_MAX, out_status);
}


x86 assembly (clang, -O0):
<parse_ull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <parse_ull_bounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_ull>:
mov    %rsi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <parse_ull_bounds@plt>

LLVM IR (-O0):
@ULLONG_MAX = global i32 0
define i64 @parse_ull(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @ULLONG_MAX
%7 = load i32*, i32** %4
%8 = call i64 @parse_ull_bounds(i8* %5, i32 0, i32 %6, i32* %7)
ret i64 %8
}

LLVM IR (-O2):
@ULLONG_MAX = global i32 0
define i64 @parse_ull(i8* %0, i32* %1) {
%3 = load i32, i32* @ULLONG_MAX
%4 = tail call i64 @parse_ull_bounds(i8* %0, i32 0, i32 %3, i32* %1)
ret i64 %4
}
void io_ddr_config_in(char *pin) {}


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

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

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

LLVM IR (-O2):
define void @io_ddr_config_in(i8* nocapture %0) {
ret void
}
double square(int x) { return x * x; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
imul   %edi,%edi
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @square(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void displayArray(int nbValue, double *array) {
  int i = 0;
  for (i = 0; i < nbValue; ++i) {
    printf("%e \n", array[i]);
  }
}


x86 assembly (clang, -O0):
<displayArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1160 <displayArray+0x50>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <displayArray+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <displayArray+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <displayArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%e \0A\00"
define void @displayArray(i32 %0, double* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum = 2;
  int term_1 = 1;
  int term_2 = 2;
  int term_sum;
  while (term_sum < 4000000) {
    term_sum = term_1 + term_2;
    term_1 = term_2;
    term_2 = term_sum;
    if (term_sum % 2 == 0)
      sum += term_sum;
  }
  printf("answer: %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
cmpl   $0x3d0900,-0x14(%rbp)
jge    1178 <main+0x68>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1173 <main+0x63>
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
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    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"answer: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4000000
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %9
%19 = load i32, i32* %5
%20 = load i32, i32* %2
%21 = add nsw i32 %20, %19
store i32 %21, i32* %2
br label %22
22: ; preds = %18, %9
br label %6
23: ; preds = %6
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"answer: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void memzero_aligned(void *dst, size_t n) { memset(dst, 0, n); }


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

x86 assembly (clang, -O2):
<memzero_aligned>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @memzero_aligned(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 i32 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @memzero_aligned(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ stdout;
void getstr(char *instr, char *outstr) {
  fprintf(stdout, "%s: ", instr);
  gets(outstr);
}


x86 assembly (clang, -O0):
<getstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <gets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstr>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <gets@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%s: \00"
define void @getstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @gets(i8* %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%s: \00"
define void @getstr(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @gets(i8* %1)
ret void
}
void ofi_osd_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ofi_osd_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ msort(int *, int *, int /*<<< orphan*/, int);
void mergeSort(int A[], int N) {
  int *tmpArray;
  tmpArray = malloc(N * sizeof(int));
  assert(tmpArray);
  msort(A, tmpArray, 0, N - 1);
  free(tmpArray);
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1040 <msort@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <assert@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
call   1040 <msort@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mergeSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = call i32 @assert(i32* %11)
%13 = load i32*, i32** %3
%14 = load i32*, i32** %5
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i32 @msort(i32* %13, i32* %14, i32 0, i32 %16)
%18 = load i32*, i32** %5
%19 = call i32 @free(i32* %18)
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = tail call i32 @assert(i32* %4)
%6 = add nsw i32 %1, -1
%7 = tail call i32 @msort(i32* %0, i32* %4, i32 0, i32 %6)
%8 = tail call i32 @free(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main() {
  sleep(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pledge_wrapper(char *);
void reduceprivileges(void) { pledge_wrapper("stdio"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"stdio\00"
define void @reduceprivileges() {
%1 = tail call i32 @pledge_wrapper(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_ppp_profile_list_1_svc(void *, struct svc_req *);
int _l2tp_ppp_profile_list_1(void *argp, void *result, struct svc_req *rqstp) {
  return (l2tp_ppp_profile_list_1_svc(result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_ppp_profile_list_1>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <l2tp_ppp_profile_list_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_ppp_profile_list_1(i8* %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8*, i8** %5
%8 = load %struct.svc_req*, %struct.svc_req** %6
%9 = call i32 @l2tp_ppp_profile_list_1_svc(i8* %7, %struct.svc_req* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_ppp_profile_list_1(i8* nocapture readnone %0, i8* %1, %struct.svc_req* %2) {
%4 = tail call i32 @l2tp_ppp_profile_list_1_svc(i8* %1, %struct.svc_req* %2)
ret i32 %4
}
int cddb_sum(int n) {
  int ret = 0;
  n /= 75;
  while (n > 0) {
    ret += n % 10;
    n /= 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<cddb_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114a <cddb_sum+0x4a>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    111c <cddb_sum+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cddb_sum>:
xor    %eax,%eax
cmp    $0x4b,%edi
jl     113d <cddb_sum+0x3d>
mov    %edi,%eax
imul   $0x1b4e81b5,%rax,%rcx
shr    $0x23,%rcx
xor    %eax,%eax
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %ecx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %ecx,%edx
sub    %edi,%edx
add    %edx,%eax
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1120 <cddb_sum+0x20>
ret

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

LLVM IR (-O2):
define i32 @cddb_sum(i32 %0) {
%2 = icmp sgt i32 %0, 74
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = udiv i32 %0, 75
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %10, %5 ], [ %4, %3 ]
%8 = urem i32 %7, 10
%9 = add nuw nsw i32 %6, %8
%10 = udiv i32 %7, 10
%11 = icmp ult i32 %7, 10
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tokenizer_free() {
  printf("NOT IMPLEMENTED:"
         "pa_tokenizer_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_tokenizer_free\0A\00"
define i32 @pa_tokenizer_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_tokenizer_free\00"
define i32 @pa_tokenizer_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ memcpy(char *, char const *, size_t);
char *strcopy(char *dest, const char *src, size_t sz) {
  char *result = (char *)memcpy(dest, src, sz);
  dest[sz - 1] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<strcopy>:
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 <memcpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <memcpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcopy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %4
%14 = load i64, i64* %6
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
define i8* @strcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @memcpy(i8* %0, i8* %1, i64 %2)
%5 = inttoptr i64 %4 to i8*
%6 = add i64 %2, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x68() {
  Assert_real((isspace(104) == 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_isspace.c",
              525, ("isspace should be 0 for h"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x68>:
push   %rax
mov    $0x68,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x20d,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for h\00"
define void @t_isspace_0x68() {
%1 = call i64 @isspace(i32 104)
%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 525, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for h\00"
define void @t_isspace_0x68() {
%1 = tail call i64 @isspace(i32 104)
%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 525, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void floatToChar(char *buffer, float val) {
  int units = val;
  int hundredths = val * 100;
  hundredths = abs(hundredths % 100);
  sprintf(buffer, "%d.%02d", units, hundredths);
}


x86 assembly (clang, -O0):
<floatToChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  0xebf(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe91(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatToChar>:
cvttss2si %xmm0,%edx
mulss  0xee4(%rip),%xmm0
cvttss2si %xmm0,%eax
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rcx
add    %esi,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
lea    0xebb(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%d.%02d\00"
define void @floatToChar(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fptosi float %7 to i32
store i32 %8, i32* %5
%9 = load float, float* %4
%10 = fmul float %9, 1.000000e+02
%11 = fptosi float %10 to i32
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = srem i32 %12, 100
%14 = call i32 @abs(i32 %13)
store i32 %14, i32* %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d.%02d\00"
define void @floatToChar(i8* nocapture writeonly %0, float %1) {
%3 = fptosi float %1 to i32
%4 = fmul float %1, 1.000000e+02
%5 = fptosi float %4 to i32
%6 = srem i32 %5, 100
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ install_pte(unsigned long *, int, void *, unsigned long);
void install_page(unsigned long *cr3, unsigned long phys, void *virt) {
  install_pte(cr3, 1, virt, phys | (1ull << 0) | (1ull << 1));
}


x86 assembly (clang, -O0):
<install_page>:
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    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
or     $0x1,%rcx
or     $0x2,%rcx
mov    $0x1,%esi
call   1030 <install_pte@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<install_page>:
mov    %rsi,%rcx
or     $0x3,%rcx
mov    $0x1,%esi
jmp    1030 <install_pte@plt>

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

LLVM IR (-O2):
define void @install_page(i64* %0, i64 %1, i8* %2) {
%4 = or i64 %1, 3
%5 = tail call i32 @install_pte(i64* %0, i32 1, i8* %2, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mempcpy(int /*<<< orphan*/, char *, int);
void mempcpy10() {
  char a[4] = {0};
  mempcpy(0, a, 4);
}


x86 assembly (clang, -O0):
<mempcpy10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1040 <mempcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempcpy10>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1030 <mempcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mempcpy10() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @mempcpy(i32 0, i8* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @mempcpy10() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @mempcpy(i32 0, i8* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar() { printf("bar"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"bar\00"
define void @bar() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ CityHash64(char const *, size_t);
scalar_t__ HashLen16(scalar_t__, scalar_t__);
uint64_t CityStringHash64WithSeeds(const char *s, size_t len, uint64_t seed0,
                                   uint64_t seed1) {
  return HashLen16(CityHash64(s, len) - seed0, seed1);
}


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

x86 assembly (clang, -O2):
<CityStringHash64WithSeeds>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
call   1030 <CityHash64@plt>
sub    %rbx,%rax
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <HashLen16@plt>

LLVM IR (-O0):
define i64 @CityStringHash64WithSeeds(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @CityHash64(i8* %9, i64 %10)
%12 = load i64, i64* %7
%13 = sub nsw i64 %11, %12
%14 = load i64, i64* %8
%15 = call i64 @HashLen16(i64 %13, i64 %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @CityStringHash64WithSeeds(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 @CityHash64(i8* %0, i64 %1)
%6 = sub nsw i64 %5, %2
%7 = tail call i64 @HashLen16(i64 %6, i64 %3)
ret i64 %7
}