xunge/DecIR huggingface dataset:
void makecompositiontable(short *table, int *pointt) {
  int point;
  while ((point = *pointt++) != -99999990) {
    table[point]++;
  }
}


x86 assembly (clang, -O0):
<makecompositiontable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0xfa0a1f0a,%eax
je     1144 <makecompositiontable+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,2),%dx
add    $0x1,%dx
mov    %dx,(%rax,%rcx,2)
jmp    110c <makecompositiontable+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makecompositiontable>:
mov    (%rsi),%eax
cmp    $0xfa0a1f0a,%eax
je     1124 <makecompositiontable+0x24>
add    $0x4,%rsi
nopl   (%rax)
cltq
addw   $0x1,(%rdi,%rax,2)
mov    (%rsi),%eax
add    $0x4,%rsi
cmp    $0xfa0a1f0a,%eax
jne    1110 <makecompositiontable+0x10>
ret

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

LLVM IR (-O2):
define void @makecompositiontable(i16* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -99999990
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i16, i16* %0, i64 %9
%11 = load i16, i16* %10
%12 = add i16 %11, 1
store i16 %12, i16* %10
%13 = load i32, i32* %8
%14 = icmp eq i32 %13, -99999990
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle12() { kprintf("ISR %d.\n", 12); }


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

x86 assembly (clang, -O2):
<isrHandle12>:
lea    0xee9(%rip),%rdi
mov    $0xc,%esi
jmp    1030 <kprintf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle12() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}
/* Type definitions */
struct intset {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int intset_find(struct intset *, int /*<<< orphan*/, size_t *);
int /*<<< orphan*/ intset_remove_at(struct intset *, size_t);
int intset_remove(struct intset *s, int64_t val) {
  size_t index;
  int exists;
  if ((exists = intset_find(s, val, &index))) {
    intset_remove_at(s, index);
  }
  return exists;
}


x86 assembly (clang, -O0):
<intset_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x18(%rbp),%rdx
call   1040 <intset_find@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1158 <intset_remove+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <intset_remove_at@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intset_remove>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rdx
call   1040 <intset_find@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1140 <intset_remove+0x20>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1030 <intset_remove_at@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.intset = type { i32 }
define i32 @intset_remove(%struct.intset* %0, i32 %1) {
%3 = alloca %struct.intset*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store %struct.intset* %0, %struct.intset** %3
store i32 %1, i32* %4
%7 = load %struct.intset*, %struct.intset** %3
%8 = load i32, i32* %4
%9 = call i32 @intset_find(%struct.intset* %7, i32 %8, i64* %5)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.intset*, %struct.intset** %3
%13 = load i64, i64* %5
%14 = call i32 @intset_remove_at(%struct.intset* %12, i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
%struct.intset = type { i32 }
define i32 @intset_remove(%struct.intset* %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @intset_find(%struct.intset* %0, i32 %1, i64* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = call i32 @intset_remove_at(%struct.intset* %0, i64 %8)
br label %10
10: ; preds = %7, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_UD_OUTPUT() { set_io_bit(0x36, 1); }


x86 assembly (clang, -O0):
<TOSH_MAKE_UD_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x1,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_UD_OUTPUT>:
mov    $0x36,%edi
mov    $0x1,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_UD_OUTPUT() {
%1 = call i32 @set_io_bit(i32 54, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_UD_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 54, i32 1)
ret void
}
int q(void) {}


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

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

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

LLVM IR (-O2):
define i32 @q() {
ret i32 undef
}
void f(int i, int j) {
#pragma hlt block factors(20)
  for (i = 0; i < 100 && j > 20; i++, j--) {
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    112a <f+0x2a>
cmpl   $0x14,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113a <f+0x3a>
jmp    1156 <f+0x56>
jmp    113f <f+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <f+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int PAPI_flips(float *, float *, long long *, float *);
void papif_flips__(float *real_time, float *proc_time, long long *flpins,
                   float *mflips, int *check) {
  *check = PAPI_flips(real_time, proc_time, flpins, mflips);
}


x86 assembly (clang, -O0):
<papif_flips__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_flips@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_flips__>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_flips@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_flips__(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_flips(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_flips__(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_flips(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Type definitions */
struct regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct regs *);
void regs_destroy(struct regs *env) { free(env); }


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

x86 assembly (clang, -O2):
<regs_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.regs = type { i32 }
define void @regs_destroy(%struct.regs* nocapture %0) {
%2 = tail call i32 @free(%struct.regs* %0)
ret void
}
int main() {
  for (;;) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void jsoo_inject() { exit(1); }


x86 assembly (clang, -O0):
<jsoo_inject>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<jsoo_inject>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @jsoo_inject() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @jsoo_inject() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_0Eint16_mem(short *val) {
  return ((*val) & (-0x0E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Eint16_mem>:
movzwl (%rdi),%eax
test   $0xfff2,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Eint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -14
%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_0Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -14
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G90_f(char *s) {
  debug("G90_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G90_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G90_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G90_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G90_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G90_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G90_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int strcmp(char *, char *);
int strcmp_void(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


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

x86 assembly (clang, -O2):
<strcmp_void>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strcmp_void(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ msort(int *, int *, int /*<<< orphan*/, int);
void sort(int a[], int len) {
  int *b;
  if (len > 1) {
    b = malloc(sizeof(int) * len);
    msort(a, b, 0, len - 1);
  }
}


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

x86 assembly (clang, -O2):
<sort>:
cmp    $0x2,%esi
jl     1153 <sort+0x33>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <msort@plt>
ret

LLVM IR (-O0):
define void @sort(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 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = trunc i64 %11 to i32
%13 = call i32* @malloc(i32 %12)
store i32* %13, i32** %5
%14 = load i32*, i32** %3
%15 = load i32*, i32** %5
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = call i32 @msort(i32* %14, i32* %15, i32 0, i32 %17)
br label %19
19: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = shl i32 %1, 2
%6 = tail call i32* @malloc(i32 %5)
%7 = add nsw i32 %1, -1
%8 = tail call i32 @msort(i32* %0, i32* %6, i32 0, i32 %7)
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
double *b(double *, int);
int /*<<< orphan*/ free(double *);
main() {
  double v[4] = {1, 2, 3, 10};
  double *sum = b(v, 4);
  free(sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <b@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <b@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.v = [4 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 1.000000e+01]
define i32 @main() {
%1 = alloca [4 x double]
%2 = alloca double*
%3 = bitcast [4 x double]* %1 to i8*
%4 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%5 = call double* @b(double* %4, i32 4)
store double* %5, double** %2
%6 = load double*, double** %2
%7 = call i32 @free(double* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.v = [4 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 1.000000e+01]
define i32 @main() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%4 = call double* @b(double* %3, i32 4)
%5 = call i32 @free(double* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void clr5(int *x) { memset(x, 0, 5); }


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

x86 assembly (clang, -O2):
<clr5>:
xor    %esi,%esi
mov    $0x5,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clr5(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void usage(FILE *out, int code) {
  fprintf(out, "Usage:\n\n"
               "erasetup [-h|--help] [-v|--verbose] [-f|--force]\n"
               "         <command> [command options]\n\n"
               "         create <name> <metadata-dev> <data-dev> [chunk-size]\n"
               "         open <name> <metadata-dev> <data-dev>\n"
               "         close <name>\n"
               "         status [name]\n"
               "         dumpmeta <metadata-dev>\n\n"
               "         takesnap <name> <snapshot-dev>\n"
               "         dropsnap <snapshot-dev>\n"
               "         dumpsnap <metadata-dev>\n"
               "\n");
  exit(code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
lea    0xed3(%rip),%rdi
mov    $0x186,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [391 x i8] c"Usage:\0A\0Aerasetup [-h|--help] [-v|--verbose] [-f|--force]\0A <command> [command options]\0A\0A create <name> <metadata-dev> <data-dev> [chunk-size]\0A open <name> <metadata-dev> <data-dev>\0A close <name>\0A status [name]\0A dumpmeta <metadata-dev>\0A\0A takesnap <name> <snapshot-dev>\0A dropsnap <snapshot-dev>\0A dumpsnap <metadata-dev>\0A\0A\00"
define void @usage(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [391 x i8] c"Usage:\0A\0Aerasetup [-h|--help] [-v|--verbose] [-f|--force]\0A <command> [command options]\0A\0A create <name> <metadata-dev> <data-dev> [chunk-size]\0A open <name> <metadata-dev> <data-dev>\0A close <name>\0A status [name]\0A dumpmeta <metadata-dev>\0A\0A takesnap <name> <snapshot-dev>\0A dropsnap <snapshot-dev>\0A dumpsnap <metadata-dev>\0A\0A\00"
define void @usage(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0), i64 390, i64 1, i32* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
void __attribute__((used)) used_fn(void) {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @used_fn to i8*)], section "llvm.metadata"
define void @used_fn() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @used_fn to i8*)], section "llvm.metadata"
define void @used_fn() {
ret void
}
void f2(void) {
  int i = 0;
#pragma omp task default(shared) if (0)
  {
#pragma omp simd
    for (i = 0; i < 100; i++)
      ;
  }
  if (i != 100)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1143 <f2+0x33>
jmp    1135 <f2+0x25>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <f2+0x16>
cmpl   $0x64,-0x4(%rbp)
je     1152 <f2+0x42>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 100
br i1 %11, label %12, label %13
12: ; preds = %9
unreachable
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
const char *lv_fs_get_real_path(const char *path) {
  path++;
  while (*path != '\0') {
    if (*path == ':' || *path == '\\' || *path == '/') {
      path++;
    } else {
      break;
    }
  }
  return path;
}


x86 assembly (clang, -O0):
<lv_fs_get_real_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <lv_fs_get_real_path+0x6f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     1154 <lv_fs_get_real_path+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1154 <lv_fs_get_real_path+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1165 <lv_fs_get_real_path+0x65>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116a <lv_fs_get_real_path+0x6a>
jmp    116f <lv_fs_get_real_path+0x6f>
jmp    1114 <lv_fs_get_real_path+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lv_fs_get_real_path>:
mov    %rdi,%rax
add    $0x1,%rax
movabs $0x200000000801,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%edx
add    $0xd1,%dl
cmp    $0x2d,%dl
ja     113a <lv_fs_get_real_path+0x3a>
movzbl %dl,%edx
bt     %rdx,%rcx
jae    113a <lv_fs_get_real_path+0x3a>
add    $0x1,%rax
jmp    1120 <lv_fs_get_real_path+0x20>
ret

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

LLVM IR (-O2):
define i8* @lv_fs_get_real_path(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %4, %6 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 47, label %6
i8 58, label %6
i8 92, label %6
]
6: ; preds = %2, %2, %2
br label %2
7: ; preds = %2
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
unsigned long runtime() {
  static time_t t0 = 0;
  time_t t1 = time(NULL);
  if (t0 == 0)
    t0 = t1;
  return t1 - t0;
}


x86 assembly (clang, -O0):
<runtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,0x2f03(%rip)
jne    113e <runtime+0x2e>
mov    -0x8(%rbp),%rax
mov    %rax,0x2ef2(%rip)
mov    -0x8(%rbp),%rax
sub    0x2ee7(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runtime>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    0x2f11(%rip),%rcx
test   %rcx,%rcx
jne    112e <runtime+0x1e>
mov    %rax,0x2f05(%rip)
mov    %rax,%rcx
sub    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@runtime.t0 = internal global i64 0
define i64 @runtime() {
%1 = alloca i64
%2 = call i64 @time(i32* null)
store i64 %2, i64* %1
%3 = load i64, i64* @runtime.t0
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i64, i64* %1
store i64 %6, i64* @runtime.t0
br label %7
7: ; preds = %5, %0
%8 = load i64, i64* %1
%9 = load i64, i64* @runtime.t0
%10 = sub nsw i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
@runtime.t0 = internal unnamed_addr global i64 0
define i64 @runtime() {
%1 = tail call i64 @time(i32* null)
%2 = load i64, i64* @runtime.t0
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i64 %1, i64* @runtime.t0
br label %5
5: ; preds = %4, %0
%6 = phi i64 [ %1, %4 ], [ %2, %0 ]
%7 = sub nsw i64 %1, %6
ret i64 %7
}
/* Variables and functions */
int r_read(int, char *, int);
int d_read(int fd, char *buffer, int number) {
  return r_read(fd, buffer, number);
}


x86 assembly (clang, -O0):
<d_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <r_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_read>:
jmp    1030 <r_read@plt>

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

LLVM IR (-O2):
define i32 @d_read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @r_read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int seteuid(uid_t euid) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<seteuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seteuid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @seteuid(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int get_end_pre_l2(int);
int get_size_l2(int);
int get_end_l2(int port) { return get_end_pre_l2(port) + get_size_l2(port); }


x86 assembly (clang, -O0):
<get_end_l2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_end_pre_l2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_size_l2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_end_l2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <get_end_pre_l2@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <get_size_l2@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_end_l2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_end_pre_l2(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @get_size_l2(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_end_l2(i32 %0) {
%2 = tail call i32 @get_end_pre_l2(i32 %0)
%3 = tail call i32 @get_size_l2(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
unsigned long next_power_of_two(unsigned long size) {
  size--;
  size |= (size >> 1);
  size |= (size >> 2);
  size |= (size >> 4);
  size |= (size >> 8);
  size |= (size >> 16);
  size |= (size >> 32);
  size++;
  return size;
}


x86 assembly (clang, -O0):
<next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @next_power_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = lshr i64 %25, 32
%27 = load i64, i64* %2
%28 = or i64 %27, %26
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = add i64 %29, 1
store i64 %30, i64* %2
%31 = load i64, i64* %2
ret i64 %31
}

LLVM IR (-O2):
define i64 @next_power_of_two(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
int wproc_can_spawn(struct load_control *lc) { return 1; }


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

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

LLVM IR (-O0):
%struct.load_control = type opaque
define i32 @wproc_can_spawn(%struct.load_control* %0) {
%2 = alloca %struct.load_control*
store %struct.load_control* %0, %struct.load_control** %2
ret i32 1
}

LLVM IR (-O2):
%struct.load_control = type opaque
define i32 @wproc_can_spawn(%struct.load_control* nocapture readnone %0) {
ret i32 1
}
int av_isgraph(int c) { return c > 32 && c < 127; }


x86 assembly (clang, -O0):
<av_isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <av_isgraph+0x20>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @av_isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @av_isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ anonmap_init();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_1();
int /*<<< orphan*/ test_2();
int /*<<< orphan*/ test_3();
int main() {
  anonmap_init();
  test_1();
  test_2();
  test_3();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <anonmap_init@plt>
mov    $0x0,%al
call   1030 <test_1@plt>
mov    $0x0,%al
call   1040 <test_2@plt>
mov    $0x0,%al
call   1070 <test_3@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <anonmap_init@plt>
xor    %eax,%eax
call   1030 <test_1@plt>
xor    %eax,%eax
call   1040 <test_2@plt>
xor    %eax,%eax
call   1070 <test_3@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @anonmap_init()
%3 = call i32 (...) @test_1()
%4 = call i32 (...) @test_2()
%5 = call i32 (...) @test_3()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @anonmap_init()
%2 = tail call i32 (...) @test_1()
%3 = tail call i32 (...) @test_2()
%4 = tail call i32 (...) @test_3()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_epu16(int /*<<< orphan*/ const, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_setzero_si128();
int /*<<< orphan*/ _mm_srli_epi16(int /*<<< orphan*/, int);
__m128i xx_roundn_epu16(__m128i v_val_w, int bits) {
  const __m128i v_s_w = _mm_srli_epi16(v_val_w, bits - 1);
  return _mm_avg_epu16(v_s_w, _mm_setzero_si128());
}


x86 assembly (clang, -O0):
<xx_roundn_epu16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1040 <_mm_srli_epi16@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_avg_epu16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xx_roundn_epu16>:
push   %rbx
add    $0xffffffff,%esi
call   1040 <_mm_srli_epi16@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <_mm_avg_epu16@plt>

LLVM IR (-O0):
define i32 @xx_roundn_epu16(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* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = call i32 @_mm_srli_epi16(i32 %6, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 (...) @_mm_setzero_si128()
%12 = call i32 @_mm_avg_epu16(i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @xx_roundn_epu16(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @_mm_srli_epi16(i32 %0, i32 %3)
%5 = tail call i32 (...) @_mm_setzero_si128()
%6 = tail call i32 @_mm_avg_epu16(i32 %4, i32 %5)
ret i32 %6
}
int test_imm_CDint64_lowword_mem(long long *val) {
  return ((*val) & (0xCD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CDint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 205
%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_CDint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 205
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void deinit_mmap_mutex() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_storel_epi64(void *, int /*<<< orphan*/);
void test_storel_epi64(__m128i x, void *y) { _mm_storel_epi64(y, x); }


x86 assembly (clang, -O0):
<test_storel_epi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <_mm_storel_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_storel_epi64>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <_mm_storel_epi64@plt>

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

LLVM IR (-O2):
define void @test_storel_epi64(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_storel_epi64(i8* %1, i32 %0)
ret void
}
const int tst_val(void) { return 'drag'; }


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

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

LLVM IR (-O0):
define i32 @tst_val() {
ret i32 1685217639
}

LLVM IR (-O2):
define i32 @tst_val() {
ret i32 1685217639
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *tmp_name(void) {
  static char name[30];
  static int sequence = 0;
  ++sequence;
  strcpy(name, "tmp");
  name[3] = sequence + '0';
  name[4] = '\0';
  return (name);
}


x86 assembly (clang, -O0):
<tmp_name>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f46(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f3d(%rip)
lea    0x2f16(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2f24(%rip),%eax
add    $0x30,%eax
mov    %al,0x2efe(%rip)
movb   $0x0,0x2ef8(%rip)
lea    0x2eed(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmp_name>:
push   %rbx
addl   $0x1,0x2f48(%rip)
lea    0x2f21(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    0x2f2c(%rip),%al
add    $0x30,%al
mov    %al,0x2f07(%rip)
movb   $0x0,0x2f01(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@tmp_name.name = internal global [30 x i8] zeroinitializer
@tmp_name.sequence = internal global i32 0
@.str = [4 x i8] c"tmp\00"
define i8* @tmp_name() {
%1 = load i32, i32* @tmp_name.sequence
%2 = add nsw i32 %1, 1
store i32 %2, i32* @tmp_name.sequence
%3 = call i32 @strcpy(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @tmp_name.sequence
%5 = add nsw i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 4)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 0)
}

LLVM IR (-O2):
@tmp_name.name = internal global [30 x i8] zeroinitializer
@tmp_name.sequence = internal unnamed_addr global i32 0
@.str = [4 x i8] c"tmp\00"
define i8* @tmp_name() {
%1 = load i32, i32* @tmp_name.sequence
%2 = add nsw i32 %1, 1
store i32 %2, i32* @tmp_name.sequence
%3 = tail call i32 @strcpy(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @tmp_name.sequence
%5 = trunc i32 %4 to i8
%6 = add i8 %5, 48
store i8 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 4)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @tmp_name.name, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg, int line) {
  fprintf(stderr, "ERROR [line: %d] %s\n", line, msg);
  cleanup();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rcx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"ERROR [line: %d] %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = tail call i32 (...) @cleanup()
ret void
}
void default_mpgdecoder_init(void *ctx) {}


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

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

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

LLVM IR (-O2):
define void @default_mpgdecoder_init(i8* nocapture %0) {
ret void
}
const char *strempty(const char *s) { return s ? s : ""; }


x86 assembly (clang, -O0):
<strempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <strempty+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <strempty+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <strempty+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strempty>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @strempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @strempty(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ cpu_reset(int /*<<< orphan*/);
void arch_reset(char mode) {
  if (1 && mode == 's') {
    cpu_reset(0);
  } else {
  }
}


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x73,%eax
jne    1137 <arch_reset+0x27>
xor    %edi,%edi
call   1030 <cpu_reset@plt>
jmp    113c <arch_reset+0x2c>
jmp    113c <arch_reset+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_reset>:
cmp    $0x73,%dil
jne    111d <arch_reset+0xd>
xor    %edi,%edi
jmp    1030 <cpu_reset@plt>
ret

LLVM IR (-O0):
define void @arch_reset(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 115
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @cpu_reset(i32 0)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @arch_reset(i8 signext %0) {
%2 = icmp eq i8 %0, 115
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @cpu_reset(i32 0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: webcomp prefix \n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"usage: webcomp prefix \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"usage: webcomp prefix \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}