xunge/DecIR huggingface dataset:
int itlp2i(double dp, double tlmin, double binsiz,
           int UNUSED_type __attribute__((__unused__))) {
  if ((binsiz == 1.0) || (binsiz <= 0.0)) {
    return (int)((dp - tlmin) + 1.0);
  } else {
    return (int)((dp - tlmin) / binsiz + 1.0);
  }
}


x86 assembly (clang, -O0):
<itlp2i>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xedd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1138 <itlp2i+0x38>
jp     1138 <itlp2i+0x38>
jmp    1146 <itlp2i+0x46>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1168 <itlp2i+0x68>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    118a <itlp2i+0x8a>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itlp2i>:
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
movapd %xmm2,%xmm3
cmplesd %xmm1,%xmm3
movsd  0xee7(%rip),%xmm1
movapd %xmm3,%xmm4
andpd  %xmm1,%xmm4
andnpd %xmm2,%xmm3
orpd   %xmm4,%xmm3
cmpeqsd %xmm1,%xmm2
movapd %xmm2,%xmm4
andnpd %xmm3,%xmm4
andpd  %xmm1,%xmm2
orpd   %xmm4,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @itlp2i(double %0, double %1, double %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store i32 %3, i32* %9
%10 = load double, double* %8
%11 = fcmp oeq double %10, 1.000000e+00
br i1 %11, label %15, label %12
12: ; preds = %4
%13 = load double, double* %8
%14 = fcmp ole double %13, 0.000000e+00
br i1 %14, label %15, label %21
15: ; preds = %12, %4
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fsub double %16, %17
%19 = fadd double %18, 1.000000e+00
%20 = fptosi double %19 to i32
store i32 %20, i32* %5
br label %29
21: ; preds = %12
%22 = load double, double* %6
%23 = load double, double* %7
%24 = fsub double %22, %23
%25 = load double, double* %8
%26 = fdiv double %24, %25
%27 = fadd double %26, 1.000000e+00
%28 = fptosi double %27 to i32
store i32 %28, i32* %5
br label %29
29: ; preds = %21, %15
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @itlp2i(double %0, double %1, double %2, i32 %3) {
%5 = fcmp oeq double %2, 1.000000e+00
%6 = fcmp ole double %2, 0.000000e+00
%7 = or i1 %5, %6
%8 = fsub double %0, %1
%9 = select i1 %7, double 1.000000e+00, double %2
%10 = fdiv double %8, %9
%11 = fadd double %10, 1.000000e+00
%12 = fptosi double %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef void DIR;

/* Variables and functions */
void *opendir(char *);
int /*<<< orphan*/ wcstombs(char *, int /*<<< orphan*/ const *, int);
void *osal_search_dir_open(const wchar_t *_pathname) {
  char pathname[260];
  wcstombs(pathname, _pathname, 260);
  DIR *dir;
  dir = opendir(pathname);
  return dir;
}


x86 assembly (clang, -O0):
<osal_search_dir_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x104,%edx
call   1040 <wcstombs@plt>
lea    -0x110(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osal_search_dir_open>:
push   %rbx
sub    $0x110,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x104,%edx
call   1040 <wcstombs@plt>
mov    %rbx,%rdi
call   1030 <opendir@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @osal_search_dir_open(i32* %0) {
%2 = alloca i32*
%3 = alloca [260 x i8]
%4 = alloca i8*
store i32* %0, i32** %2
%5 = getelementptr inbounds [260 x i8], [260 x i8]* %3, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32 @wcstombs(i8* %5, i32* %6, i32 260)
%8 = getelementptr inbounds [260 x i8], [260 x i8]* %3, i64 0, i64 0
%9 = call i8* @opendir(i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @osal_search_dir_open(i32* %0) {
%2 = alloca [260 x i8]
%3 = getelementptr inbounds [260 x i8], [260 x i8]* %2, i64 0, i64 0
%4 = call i32 @wcstombs(i8* %3, i32* %0, i32 260)
%5 = call i8* @opendir(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
char strings_and_buffers(const char *restrict s, char **b) {
  printf("foo: %c", *s);
  (*b)[0] = 'a';
  return *s;
}


x86 assembly (clang, -O0):
<strings_and_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed5(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_and_buffers>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rdi),%al
movsbl %al,%ebp
lea    0xede(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    (%rbx),%rax
movb   $0x61,(%rax)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"foo: %c\00"
define signext i8 @strings_and_buffers(i8* noalias %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* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 97, i8* %10
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
ret i8 %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"foo: %c\00"
define signext i8 @strings_and_buffers(i8* noalias nocapture %0, i8** nocapture %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = load i8*, i8** %1
store i8 97, i8* %5
ret i8 %3
}
int test_imm_F8uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xF8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F8uint64_midword_reg>:
test   $0xf80000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F8uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16252928
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void do_irq() {}


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

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

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

LLVM IR (-O2):
define void @do_irq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mpu6000SettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void Mpu6000SettingsRequestUpdate() {
  UAVObjRequestUpdate(Mpu6000SettingsHandle());
}


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

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

LLVM IR (-O0):
define void @Mpu6000SettingsRequestUpdate() {
%1 = call i32 (...) @Mpu6000SettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Mpu6000SettingsRequestUpdate() {
%1 = tail call i32 (...) @Mpu6000SettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_table();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yyparse();
main() {
  printf("Teoria de compiladores.\n");
  printf("Invocando a funcion parse.\n");
  init_table();
  yyparse();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
lea    0xed2(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <init_table@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"Teoria de compiladores.\0A\00"
@.str.1 = [28 x i8] c"Invocando a funcion parse.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @init_table()
%4 = call i32 (...) @yyparse()
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Teoria de compiladores.\00"
@str.2 = [27 x i8] c"Invocando a funcion parse.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @init_table()
%4 = tail call i32 (...) @yyparse()
ret i32 0
}
void glmGenerateIdentityMatrix2d(double m[4]) {
  m[0] = 1;
  m[2] = 0;
  m[1] = 0;
  m[3] = 1;
}


x86 assembly (clang, -O0):
<glmGenerateIdentityMatrix2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateIdentityMatrix2d>:
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rdi)
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateIdentityMatrix2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double 1.000000e+00, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 2
store double 0.000000e+00, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 1
store double 0.000000e+00, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 3
store double 1.000000e+00, double* %10
ret void
}

LLVM IR (-O2):
define void @glmGenerateIdentityMatrix2d(double* nocapture writeonly %0) {
store double 1.000000e+00, double* %0
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = bitcast double* %2 to i8*
store double 1.000000e+00, double* %3
ret void
}
unsigned long read_cr3(void) {
  unsigned long val;
  asm volatile("mov %%cr3, %0" : "=r"(val) : : "memory");
  return val;
}


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

x86 assembly (clang, -O2):
<read_cr3>:
mov    %cr3,%rax
ret

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

LLVM IR (-O2):
define i64 @read_cr3() {
%1 = tail call i64 asm sideeffect "mov %cr3, $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
unsigned long default_hash(const void *key) {
  unsigned long hash = *(int *)key;
  unsigned long high_order = 0;
  high_order = hash & 0xf8000000;
  hash = hash << 5;
  hash = hash ^ (high_order >> 27);
  hash = hash ^ 1;
  return hash;
}


x86 assembly (clang, -O0):
<default_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movabs $0xf8000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x1b,%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_hash>:
movslq (%rdi),%rax
mov    %rax,%rcx
shl    $0x5,%rcx
shr    $0x1b,%eax
or     %rcx,%rax
xor    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @default_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
store i64 0, i64* %4
%9 = load i64, i64* %3
%10 = and i64 %9, 4160749568
store i64 %10, i64* %4
%11 = load i64, i64* %3
%12 = shl i64 %11, 5
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = lshr i64 %14, 27
%16 = xor i64 %13, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = xor i64 %17, 1
store i64 %18, i64* %3
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @default_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = shl nsw i64 %4, 5
%6 = lshr i64 %4, 27
%7 = and i64 %6, 31
%8 = or i64 %7, %5
%9 = xor i64 %8, 1
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ fill_hexagon(int, int /*<<< orphan*/);
void clear_hexagon(void) {
  int layer;
  for (layer = 0; layer <= 8; layer++)
    fill_hexagon(layer, 0);
}


x86 assembly (clang, -O0):
<clear_hexagon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jg     1141 <clear_hexagon+0x31>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <clear_hexagon+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_hexagon>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <fill_hexagon@plt>
mov    $0x8,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <fill_hexagon@plt>

LLVM IR (-O0):
define void @clear_hexagon() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 8
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @fill_hexagon(i32 %6, i32 0)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @clear_hexagon() {
%1 = tail call i32 @fill_hexagon(i32 0, i32 0)
%2 = tail call i32 @fill_hexagon(i32 1, i32 0)
%3 = tail call i32 @fill_hexagon(i32 2, i32 0)
%4 = tail call i32 @fill_hexagon(i32 3, i32 0)
%5 = tail call i32 @fill_hexagon(i32 4, i32 0)
%6 = tail call i32 @fill_hexagon(i32 5, i32 0)
%7 = tail call i32 @fill_hexagon(i32 6, i32 0)
%8 = tail call i32 @fill_hexagon(i32 7, i32 0)
%9 = tail call i32 @fill_hexagon(i32 8, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MSG_NOSIGNAL;
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int unknown_command(int socket) {
  send(socket, "Unknown command\n", strlen("Unknown command\n"), MSG_NOSIGNAL);
  return 1;
}


x86 assembly (clang, -O0):
<unknown_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
mov    0x2e97(%rip),%rax
mov    (%rax),%ecx
lea    0xeae(%rip),%rsi
call   1040 <send@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_command>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%ecx
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <send@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Unknown command\0A\00"
@MSG_NOSIGNAL = global i32 0
define i32 @unknown_command(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strlen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @MSG_NOSIGNAL
%6 = call i32 @send(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"Unknown command\0A\00"
@MSG_NOSIGNAL = global i32 0
define i32 @unknown_command(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @MSG_NOSIGNAL
%4 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
scalar_t__ alloca(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ setjmp(int /*<<< orphan*/);
int /*<<< orphan*/ sub5(int /*<<< orphan*/);
void test(int x) {
  jmp_buf buf;
  char *foo;
  int arr[100];
  arr[77] = x;
  if (setjmp(buf)) {
    printf("made it ok; %d\n", arr[77]);
    return;
  }
  foo = (char *)alloca(128);
  sub5(buf);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <setjmp@plt>
cmp    $0x0,%rax
je     117a <test+0x3a>
mov    -0x6c(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <test+0x50>
mov    $0x80,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <sub5@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1060 <setjmp@plt>
test   %rax,%rax
je     115c <test+0x1c>
lea    0xeac(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
mov    $0x80,%edi
call   1040 <alloca@plt>
pop    %rbx
jmp    1050 <sub5@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"made it ok; %d\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [100 x i32]
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 77
store i32 %6, i32* %7
%8 = load i32, i32* %3
%9 = call i64 @setjmp(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 77
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %20
15: ; preds = %1
%16 = call i64 @alloca(i32 128)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %4
%18 = load i32, i32* %3
%19 = call i32 @sub5(i32 %18)
br label %20
20: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"made it ok; %d\0A\00"
define void @test(i32 %0) {
%2 = tail call i64 @setjmp(i32 undef)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
6: ; preds = %1
%7 = tail call i64 @alloca(i32 128)
%8 = tail call i32 @sub5(i32 undef)
br label %9
9: ; preds = %6, %4
ret void
}
__attribute__((always_)) struct irq_desc *move_irq_desc(struct irq_desc *desc,
                                                        int node) {
  return desc;
}


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

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

LLVM IR (-O0):
%struct.irq_desc = type opaque
define %struct.irq_desc* @move_irq_desc(%struct.irq_desc* %0, i32 %1) {
%3 = alloca %struct.irq_desc*
%4 = alloca i32
store %struct.irq_desc* %0, %struct.irq_desc** %3
store i32 %1, i32* %4
%5 = load %struct.irq_desc*, %struct.irq_desc** %3
ret %struct.irq_desc* %5
}

LLVM IR (-O2):
%struct.irq_desc = type opaque
define %struct.irq_desc* @move_irq_desc(%struct.irq_desc* readnone returned %0, i32 %1) {
ret %struct.irq_desc* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void assertArray(long type) {
  if (type < 1) {
    fprintf(stderr, "ERROR array-like access to non-array symbol detected\n");
    exit(3);
  }
}


x86 assembly (clang, -O0):
<assertArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jge    1156 <assertArray+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertArray>:
test   %rdi,%rdi
jle    1126 <assertArray+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"ERROR array-like access to non-array symbol detected\0A\00"
define void @assertArray(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 3)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"ERROR array-like access to non-array symbol detected\0A\00"
define void @assertArray(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 3)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
client(int rd, int wr) { printf("client called with %d %d\n", rd, wr); }


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

x86 assembly (clang, -O2):
<client>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [26 x i8] c"client called with %d %d\0A\00"
define i32 @client(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
scalar_t__ mp_islower(char);
scalar_t__ mp_isupper(char);
int mp_isalpha(char c) { return mp_isupper(c) || mp_islower(c); }


x86 assembly (clang, -O0):
<mp_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <mp_isupper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <mp_isalpha+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <mp_islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <mp_isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <mp_isalpha+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <mp_islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mp_isalpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @mp_isupper(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @mp_islower(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @mp_isalpha(i8 signext %0) {
%2 = tail call i64 @mp_isupper(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @mp_islower(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ creat(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void create_file(char *filename) {
  if (creat(filename, 0755) < 0) {
    printf("Create file %s failure!\n", filename);
    return;
  } else {
    printf("Create file %s success!\n", filename);
  }
}


x86 assembly (clang, -O0):
<create_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <creat@plt>
cmp    $0x0,%rax
jge    1159 <create_file+0x39>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <create_file+0x49>
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_file>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1ed,%esi
call   1040 <creat@plt>
test   %rax,%rax
lea    0xec8(%rip),%rax
lea    0xeda(%rip),%rdi
cmovs  %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Create file %s failure!\0A\00"
@.str.1 = [25 x i8] c"Create file %s success!\0A\00"
define void @create_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @creat(i8* %3, i32 493)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %6, %9
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Create file %s failure!\0A\00"
@.str.1 = [25 x i8] c"Create file %s success!\0A\00"
define void @create_file(i8* %0) {
%2 = tail call i64 @creat(i8* %0, i32 493)
%3 = icmp slt i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %0)
ret void
}
void l4x_virtual_mem_unregister(unsigned long address) {}


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

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

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

LLVM IR (-O2):
define void @l4x_virtual_mem_unregister(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nosmime();
int ccertsave(void *v) {
  nosmime();
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @ccertsave(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @nosmime()
ret i32 1
}

LLVM IR (-O2):
define i32 @ccertsave(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @nosmime()
ret i32 1
}
char *RCSid() {
  return RCSid("$Id: contour.c,v 1.29.2.1 2012/08/27 20:24:23 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [58 x i8] c"$Id: contour.c,v 1.29.2.1 2012/08/27 20:24:23 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
void testcase_assertion_teardown() {}


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

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

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

LLVM IR (-O2):
define void @testcase_assertion_teardown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%i", &a);
  scanf("%i", &b);
  f(a, b, &c);
  printf("%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <f@plt>
mov    -0x10(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
lea    0x4(%rsp),%rdx
call   1030 <f@plt>
mov    0x4(%rsp),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @f(i32 %9, i32 %10, i32* %3)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Print \n\z\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 = [10 x i8] c"Print \0Az\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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

/* Variables and functions */
struct lf_lifo *lf_lifo(void *a) {
  return (struct lf_lifo *)((intptr_t)a & ~0xffff);
}


x86 assembly (clang, -O0):
<lf_lifo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffffff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lf_lifo>:
mov    %rdi,%rax
and    $0xffffffffffff0000,%rax
ret

LLVM IR (-O0):
%struct.lf_lifo = type { i32 }
define %struct.lf_lifo* @lf_lifo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, -65536
%6 = inttoptr i64 %5 to %struct.lf_lifo*
ret %struct.lf_lifo* %6
}

LLVM IR (-O2):
%struct.lf_lifo = type { i32 }
define %struct.lf_lifo* @lf_lifo(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, -65536
%4 = inttoptr i64 %3 to %struct.lf_lifo*
ret %struct.lf_lifo* %4
}
/* Variables and functions */
int printf(char *, int, int, int);
int square(int);
int main(void) {
  return printf("square=%d, %d, %d\n", square(2), square(2), 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <square@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <square@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeae(%rip),%rdi
mov    $0x2,%ecx
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
call   1030 <square@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <square@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
mov    $0x2,%ecx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"square=%d, %d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @square(i32 2)
%2 = tail call i32 @square(i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
uint32_t __afl_get_area_size(void) {
  printf("get area size\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"get area size\0A\00"
define i32 @__afl_get_area_size() {
%1 = 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"get area size\00"
define i32 @__afl_get_area_size() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_5Bint64_lowword_reg(long long val) {
  return ((val) & (0x5B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Bint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 91
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct NeubotPoller {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_dispatch();
void NeubotPoller_loop(struct NeubotPoller *self) {
  (void)self;
  event_dispatch();
}


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

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

LLVM IR (-O0):
%struct.NeubotPoller = type { i32 }
define void @NeubotPoller_loop(%struct.NeubotPoller* %0) {
%2 = alloca %struct.NeubotPoller*
store %struct.NeubotPoller* %0, %struct.NeubotPoller** %2
%3 = load %struct.NeubotPoller*, %struct.NeubotPoller** %2
%4 = call i32 (...) @event_dispatch()
ret void
}

LLVM IR (-O2):
%struct.NeubotPoller = type { i32 }
define void @NeubotPoller_loop(%struct.NeubotPoller* nocapture readnone %0) {
%2 = tail call i32 (...) @event_dispatch()
ret void
}
void handle_56(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_56(i32 %0) {
ret void
}
int test_imm_BCint8_mem(signed char *val) {
  return ((*val) & (-0xBC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BCint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff44,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BCint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -188
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
char *one_allones_BAD() {
  static char *const base = (char *)1;
  static const unsigned long offset = -1;
  return base + offset;
}


x86 assembly (clang, -O0):
<one_allones_BAD>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@one_allones_BAD.base = internal constant i8* inttoptr (i64 1 to i8*)
@one_allones_BAD.offset = internal constant i64 -1
define i8* @one_allones_BAD() {
ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 -1)
}

LLVM IR (-O2):
define noalias i8* @one_allones_BAD() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int timeoutwrite(int, int, char *, unsigned int);
int safewrite(int fd, char *buf, unsigned int len) {
  int r;
  r = timeoutwrite(60, fd, buf, len);
  if (r <= 0)
    err(-1, "could not write to network");
  return r;
}


x86 assembly (clang, -O0):
<safewrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x3c,%edi
call   1040 <timeoutwrite@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1164 <safewrite+0x44>
mov    $0xffffffff,%edi
lea    0xea1(%rip),%rsi
call   1030 <err@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safewrite>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x3c,%edi
call   1040 <timeoutwrite@plt>
mov    %eax,%ebx
test   %eax,%eax
jg     1149 <safewrite+0x29>
lea    0xec1(%rip),%rsi
mov    $0xffffffff,%edi
call   1030 <err@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"could not write to network\00"
define i32 @safewrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @timeoutwrite(i32 60, i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @err(i32 -1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [27 x i8] c"could not write to network\00"
define i32 @safewrite(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @timeoutwrite(i32 60, i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ UpKey243(unsigned char);
void upkey(unsigned char k) { UpKey243(k); }


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

x86 assembly (clang, -O2):
<upkey>:
jmp    1030 <UpKey243@plt>

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

LLVM IR (-O2):
define void @upkey(i8 zeroext %0) {
%2 = tail call i32 @UpKey243(i8 zeroext %0)
ret void
}
int __unorddf2(double a __attribute__((unused)),
               double b __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<__unorddf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__unorddf2(double %0, double %1) {
ret i32 0
}
void *awful(int **u) {
  int a;
  a = 5;
  (*u) = &a;
}


x86 assembly (clang, -O0):
<awful>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x10(%rbp),%rax
lea    -0x14(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<awful>:
lea    -0x4(%rsp),%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define noalias i8* @awful(i32** nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32* %2, i32** %0
ret i8* undef
}
/* Variables and functions */
int test2function(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test2function() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, char *, int);
int main(int argc, char **argv) {
  test_init(argc, argv);
  test_msg("SKIP: %s:%d: "
           "Inotify not supported."
           "\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/"
           "zdtm/static/inotify_system_nodel.c",
           388);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
lea    0xeb7(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x184,%edx
call   1040 <test_msg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_init@plt>
lea    0xed3(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0x184,%edx
call   1040 <test_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"SKIP: %s:%d: Inotify not supported.\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/zdtm/static/inotify_system_nodel.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
%9 = call i32 @test_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 388)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"SKIP: %s:%d: Inotify not supported.\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/zdtm/static/inotify_system_nodel.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 @test_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 388)
ret i32 0
}