xunge/DecIR huggingface dataset:
/* Variables and functions */
char *chomp(char *s) {
  if (!s)
    return NULL;
  for (; *s; s++) {
    if (('\r' == *s) || ('\n' == *s)) {
      *s = 0;
      break;
    }
  }
  return s;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <chomp+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1184 <chomp+0x84>
jmp    1125 <chomp+0x25>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117c <chomp+0x7c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0xd,%eax
cmp    %ecx,%eax
je     115a <chomp+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    1166 <chomp+0x66>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    117c <chomp+0x7c>
jmp    116b <chomp+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1125 <chomp+0x25>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
test   %rdi,%rdi
je     1127 <chomp+0x27>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
test   %cl,%cl
je     112d <chomp+0x2d>
cmp    $0xd,%cl
je     112a <chomp+0x2a>
cmp    $0xa,%cl
je     112a <chomp+0x2a>
add    $0x1,%rax
jmp    1110 <chomp+0x10>
xor    %eax,%eax
ret
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @chomp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 13, label %6
i8 10, label %6
]
6: ; preds = %3, %3
store i8 0, i8* %4
br label %9
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %6, %1
%10 = phi i8* [ null, %1 ], [ %4, %6 ], [ %4, %3 ]
ret i8* %10
}
/* Type definitions */
struct Record {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Record *);
void Record_free(struct Record **ppRecord) {
  struct Record *pRecord;
  if (ppRecord == NULL) {
    return;
  }
  pRecord = *ppRecord;
  if (pRecord == NULL) {
    return;
  }
  free(pRecord);
  *ppRecord = NULL;
}


x86 assembly (clang, -O0):
<Record_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <Record_free+0x1c>
jmp    115b <Record_free+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <Record_free+0x37>
jmp    115b <Record_free+0x4b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Record_free>:
push   %rbx
test   %rdi,%rdi
je     112d <Record_free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <Record_free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.Record = type { i32 }
define void @Record_free(%struct.Record** %0) {
%2 = alloca %struct.Record**
%3 = alloca %struct.Record*
store %struct.Record** %0, %struct.Record*** %2
%4 = load %struct.Record**, %struct.Record*** %2
%5 = icmp eq %struct.Record** %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %17
7: ; preds = %1
%8 = load %struct.Record**, %struct.Record*** %2
%9 = load %struct.Record*, %struct.Record** %8
store %struct.Record* %9, %struct.Record** %3
%10 = load %struct.Record*, %struct.Record** %3
%11 = icmp eq %struct.Record* %10, null
br i1 %11, label %12, label %13
12: ; preds = %7
br label %17
13: ; preds = %7
%14 = load %struct.Record*, %struct.Record** %3
%15 = call i32 @free(%struct.Record* %14)
%16 = load %struct.Record**, %struct.Record*** %2
store %struct.Record* null, %struct.Record** %16
br label %17
17: ; preds = %13, %12, %6
ret void
}

LLVM IR (-O2):
%struct.Record = type { i32 }
define void @Record_free(%struct.Record** %0) {
%2 = icmp eq %struct.Record** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load %struct.Record*, %struct.Record** %0
%5 = icmp eq %struct.Record* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(%struct.Record* %4)
store %struct.Record* null, %struct.Record** %0
br label %8
8: ; preds = %3, %1, %6
ret void
}
void describe_ind_model(struct ind_model *m) {}


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

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

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

LLVM IR (-O2):
%struct.ind_model = type opaque
define void @describe_ind_model(%struct.ind_model* nocapture %0) {
ret void
}
int do_878() { return 878; }


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

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

LLVM IR (-O0):
define i32 @do_878() {
ret i32 878
}

LLVM IR (-O2):
define i32 @do_878() {
ret i32 878
}
int test_imm_1Auint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x1A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Auint64_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, 26
%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_1Auint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1703936
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void initNetwork() {}


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

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

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

LLVM IR (-O2):
define void @initNetwork() {
ret void
}
/* Variables and functions */
int _fdt_check_prop_offset(void const *, int);
int _nextprop(void const *, int);
int fdt_next_property_offset(const void *fdt, int offset) {
  if ((offset = _fdt_check_prop_offset(fdt, offset)) < 0)
    return offset;
  return _nextprop(fdt, offset);
}


x86 assembly (clang, -O0):
<fdt_next_property_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <_fdt_check_prop_offset@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1152 <fdt_next_property_offset+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <fdt_next_property_offset+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <_nextprop@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_next_property_offset>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_fdt_check_prop_offset@plt>
test   %eax,%eax
js     1138 <fdt_next_property_offset+0x18>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_nextprop@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fdt_next_property_offset(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = call i32 @_fdt_check_prop_offset(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %5
store i32 %11, i32* %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i32 @_nextprop(i8* %13, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @fdt_next_property_offset(i8* %0, i32 %1) {
%3 = tail call i32 @_fdt_check_prop_offset(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @_nextprop(i8* %0, i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: send -t <SERVER> -p <PORTNUM> -m <MESSAGE>\n");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"Usage: send -t <SERVER> -p <PORTNUM> -m <MESSAGE>\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [50 x i8] c"Usage: send -t <SERVER> -p <PORTNUM> -m <MESSAGE>\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long get_grid_index_from_address(long *, long const *);
int /*<<< orphan*/ mat_copy_vector_l3(long *, long const *);
int /*<<< orphan*/ reduce_grid_address(long *, long const *);
long grg_get_grid_index(const long address[3], const long D_diag[3]) {
  long red_adrs[3];
  mat_copy_vector_l3(red_adrs, address);
  reduce_grid_address(red_adrs, D_diag);
  return get_grid_index_from_address(red_adrs, D_diag);
}


x86 assembly (clang, -O0):
<grg_get_grid_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <mat_copy_vector_l3@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <reduce_grid_address@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_grid_index_from_address@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grg_get_grid_index>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <mat_copy_vector_l3@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <reduce_grid_address@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_grid_index_from_address@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @grg_get_grid_index(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [3 x i64]
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 0
%7 = load i64*, i64** %3
%8 = call i32 @mat_copy_vector_l3(i64* %6, i64* %7)
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 0
%10 = load i64*, i64** %4
%11 = call i32 @reduce_grid_address(i64* %9, i64* %10)
%12 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 0
%13 = load i64*, i64** %4
%14 = call i64 @get_grid_index_from_address(i64* %12, i64* %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @grg_get_grid_index(i64* %0, i64* %1) {
%3 = alloca [3 x i64]
%4 = bitcast [3 x i64]* %3 to i8*
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 0
%6 = call i32 @mat_copy_vector_l3(i64* %5, i64* %0)
%7 = call i32 @reduce_grid_address(i64* %5, i64* %1)
%8 = call i64 @get_grid_index_from_address(i64* %5, i64* %1)
ret i64 %8
}
void flipbit(char *set, int number) {
  set += number / 8;
  *set ^= 1 << (number % 8);
}


x86 assembly (clang, -O0):
<flipbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<flipbit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
cltq
xor    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @flipbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 8
%7 = load i8*, i8** %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %3
%10 = load i32, i32* %4
%11 = srem i32 %10, 8
%12 = shl i32 1, %11
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = xor i32 %15, %12
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
ret void
}

LLVM IR (-O2):
define void @flipbit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %1, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = trunc i32 %7 to i8
%10 = xor i8 %8, %9
store i8 %10, i8* %5
ret void
}
float flerpf(float a, float b, float w) { return a * (1.0f - w) + b * w; }


x86 assembly (clang, -O0):
<flerpf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flerpf>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @flerpf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @flerpf(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
float __complex__ p(float __complex__ a, float __complex__ b) {}


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

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

LLVM IR (-O0):
define <2 x float> @p(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %1, <2 x float>* %7
%8 = bitcast { float, float }* %3 to <2 x float>*
%9 = load <2 x float>, <2 x float>* %8
ret <2 x float> %9
}

LLVM IR (-O2):
define <2 x float> @p(<2 x float> %0, <2 x float> %1) {
ret <2 x float> undef
}
/* Variables and functions */
int /*<<< orphan*/ for1(int /*<<< orphan*/);
void op_for1() { for1(0); }


x86 assembly (clang, -O0):
<op_for1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <for1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_for1>:
xor    %edi,%edi
jmp    1030 <for1@plt>

LLVM IR (-O0):
define void @op_for1() {
%1 = call i32 @for1(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_for1() {
%1 = tail call i32 @for1(i32 0)
ret void
}
void ff_hevc_put_hevc_qpel_v64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v64_8_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showprompt(void) { printf("What is thy bidding?"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"What is thy bidding?\00"
define void @showprompt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"What is thy bidding?\00"
define void @showprompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_1Bint64_lowword_mem(long long *val) {
  return ((*val) & (0x1B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Bint64_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, 27
%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_1Bint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 27
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
char *itob(int /*<<< orphan*/, int, char *);
char *uint64tob(uint64_t in, char *out) { return itob(in, 64, out); }


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

x86 assembly (clang, -O2):
<uint64tob>:
mov    %rsi,%rdx
mov    $0x40,%esi
jmp    1030 <itob@plt>

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

LLVM IR (-O2):
define i8* @uint64tob(i32 %0, i8* %1) {
%3 = tail call i8* @itob(i32 %0, i32 64, i8* %1)
ret i8* %3
}
void end_doc() {}


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

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

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

LLVM IR (-O2):
define void @end_doc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int daemon(int nochdir, int noclose) {
  printf(">>> daemon, nochdir - %d, noclose - %d\n", nochdir, noclose);
  return -1;
}


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

x86 assembly (clang, -O2):
<daemon>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c">>> daemon, nochdir - %d, noclose - %d\0A\00"
define i32 @daemon(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 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 -1
}

LLVM IR (-O2):
@.str = [40 x i8] c">>> daemon, nochdir - %d, noclose - %d\0A\00"
define i32 @daemon(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 -1
}
void NV12ToRGB24Row_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB24Row_Any_SSSE3() {
ret void
}
int d_bun_mm1(double *a1, double *a2) {
  return (__builtin_isunordered(*a1, *a2));
}


x86 assembly (clang, -O0):
<d_bun_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bun_mm1>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @d_bun_mm1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp uno double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_bun_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp uno double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __NR_getpid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
void raw_syscall_getpid_run(void *arg) { syscall(__NR_getpid); }


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

x86 assembly (clang, -O2):
<raw_syscall_getpid_run>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_getpid = global i32 0
define void @raw_syscall_getpid_run(i8* nocapture readnone %0) {
%2 = load i32, i32* @__NR_getpid
%3 = tail call i32 @syscall(i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
typedef int host;
typedef int channel;

/* Variables and functions */
void __prussintc_set_hmr(volatile uint32_t *pruintc_io, uint16_t channel,
                         uint16_t host) {
  pruintc_io[(0x800 + (channel & ~(0x3))) >> 2] =
      pruintc_io[(0x800 + (channel & ~(0x3))) >> 2] |
      (((host)&0xF) << (((channel)&0x3) << 3));
}


x86 assembly (clang, -O0):
<__prussintc_set_hmr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0xfffffffc,%ecx
add    $0x800,%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%eax
and    $0xf,%eax
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
shl    %cl,%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0xfffffffc,%ecx
add    $0x800,%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__prussintc_set_hmr>:
lea    0x800(%rsi),%eax
sar    $0x2,%eax
and    $0xf,%edx
lea    0x0(,%rsi,8),%ecx
shl    %cl,%edx
cltq
or     %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @__prussintc_set_hmr(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = and i32 %8, -4
%10 = add nsw i32 2048, %9
%11 = ashr i32 %10, 2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %7, i64 %12
%14 = load volatile i32, i32* %13
%15 = load i32, i32* %6
%16 = and i32 %15, 15
%17 = load i32, i32* %5
%18 = and i32 %17, 3
%19 = shl i32 %18, 3
%20 = shl i32 %16, %19
%21 = or i32 %14, %20
%22 = load i32*, i32** %4
%23 = load i32, i32* %5
%24 = and i32 %23, -4
%25 = add nsw i32 2048, %24
%26 = ashr i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %22, i64 %27
store volatile i32 %21, i32* %28
ret void
}

LLVM IR (-O2):
define void @__prussintc_set_hmr(i32* %0, i32 %1, i32 %2) {
%4 = add i32 %1, 2048
%5 = ashr i32 %4, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load volatile i32, i32* %7
%9 = and i32 %2, 15
%10 = shl i32 %1, 3
%11 = and i32 %10, 24
%12 = shl nuw nsw i32 %9, %11
%13 = or i32 %8, %12
store volatile i32 %13, i32* %7
ret void
}
int test_01(float a, float b) { return a >= b; }


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @test_01(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_01(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
float foo008(float a, double b, double c) { return (a * b - c); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @foo008(float %0, double %1, double %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca double
store float %0, float* %4
store double %1, double* %5
store double %2, double* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %8, double %9, double %11)
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @foo008(float %0, double %1, double %2) {
%4 = fpext float %0 to double
%5 = fneg double %2
%6 = tail call double @llvm.fmuladd.f64(double %4, double %1, double %5)
%7 = fptrunc double %6 to float
ret float %7
}
unsigned int UARTRxErrorGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x14)))) &
          ((0x00000002u) | (0x00000004u) | (0x00000008u) | (0x00000010u)));
}


x86 assembly (clang, -O0):
<UARTRxErrorGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1e,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRxErrorGet>:
add    $0x14,%edi
mov    (%rdi),%eax
and    $0x1e,%eax
ret

LLVM IR (-O0):
define i32 @UARTRxErrorGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 20
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 30
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTRxErrorGet(i32 %0) {
%2 = add i32 %0, 20
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 30
ret i32 %6
}
/* Variables and functions */
char const *strerror(int);
const char *scarab_os_strerror(int err) { return strerror(err); }


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

x86 assembly (clang, -O2):
<scarab_os_strerror>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @scarab_os_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, int);
void *vc_malloc(size_t sz) {
  void *res;
  if ((res = malloc(sz)) == NULL)
    printf("!!! vc_malloc OF %u BYTES FAILED!\n", (int)sz);
  return res;
}


x86 assembly (clang, -O0):
<vc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1155 <vc_malloc+0x35>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vc_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <vc_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"!!! vc_malloc OF %u BYTES FAILED!\0A\00"
define i8* @vc_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [35 x i8] c"!!! vc_malloc OF %u BYTES FAILED!\0A\00"
define noalias i8* @vc_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = trunc i64 %0 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_WORM(struct list_head *);
uint8_t set_9840_WORM(struct list_head *m) {
  ;
  return set_WORM(m);
}


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

x86 assembly (clang, -O2):
<set_9840_WORM>:
jmp    1030 <set_WORM@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @set_9840_WORM(%struct.list_head* %0) {
%2 = tail call i32 @set_WORM(%struct.list_head* %0)
ret i32 %2
}
void core_boost_lock(void) { return; }


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

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

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

LLVM IR (-O2):
define void @core_boost_lock() {
ret void
}
int StrSize(char *s) { return (s == 0 ? 0 : *(((int *)s) - 1)); }


x86 assembly (clang, -O0):
<StrSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111d <StrSize+0x1d>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <StrSize+0x27>
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrSize>:
test   %rdi,%rdi
je     1109 <StrSize+0x9>
mov    -0x4(%rdi),%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @StrSize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = load i32, i32* %9
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 0, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @StrSize(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
int *bar(int *vector __attribute__((unused))) { return vector; }


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

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

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

LLVM IR (-O2):
define i32* @bar(i32* readnone returned %0) {
ret i32* %0
}
int trace_seq_puts(struct trace_seq *s, const char *str) { return 0; }


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

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

LLVM IR (-O0):
%struct.trace_seq = type opaque
define i32 @trace_seq_puts(%struct.trace_seq* %0, i8* %1) {
%3 = alloca %struct.trace_seq*
%4 = alloca i8*
store %struct.trace_seq* %0, %struct.trace_seq** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.trace_seq = type opaque
define i32 @trace_seq_puts(%struct.trace_seq* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int main() { return 10 + -5 % 3; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ FREE(char **);
char *malloc(int);
int main() {
  char *x = malloc(100);
  FREE(&x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <FREE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1040 <FREE@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %2
%4 = call i32 @FREE(i8** %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
store i8* %3, i8** %1
%4 = call i32 @FREE(i8** %1)
ret i32 0
}
void IgnoreVoid() { return; }


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

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

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

LLVM IR (-O2):
define void @IgnoreVoid() {
ret void
}
char *db_resolvePath(void) { return "./agenda.sqlite"; }


x86 assembly (clang, -O0):
<db_resolvePath>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_resolvePath>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"./agenda.sqlite\00"
define i8* @db_resolvePath() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"./agenda.sqlite\00"
define i8* @db_resolvePath() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ d_area(int);
scalar_t__ f_area(int);
int /*<<< orphan*/ printf(char *, int);
void main_main() {
  int res;
  res = (int)f_area(3);
  printf("f_area(3) = %d\n", res);
  res = (int)d_area(3);
  printf("d_area(3) = %d\n", res);
}


x86 assembly (clang, -O0):
<main_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1050 <f_area@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <d_area@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_main>:
push   %rax
mov    $0x3,%edi
call   1050 <f_area@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <d_area@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"f_area(3) = %d\0A\00"
@.str.1 = [16 x i8] c"d_area(3) = %d\0A\00"
define void @main_main() {
%1 = alloca i32
%2 = call i64 @f_area(i32 3)
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i64 @d_area(i32 3)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"f_area(3) = %d\0A\00"
@.str.1 = [16 x i8] c"d_area(3) = %d\0A\00"
define void @main_main() {
%1 = tail call i64 @f_area(i32 3)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i64 @d_area(i32 3)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct reservoir_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct reservoir_iterator *);
void free_reservoir_iterator(struct reservoir_iterator *ri) { free(ri); }


x86 assembly (clang, -O0):
<free_reservoir_iterator>:
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):
<free_reservoir_iterator>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.reservoir_iterator = type { i32 }
define void @free_reservoir_iterator(%struct.reservoir_iterator* nocapture %0) {
%2 = tail call i32 @free(%struct.reservoir_iterator* %0)
ret void
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};
struct katcp_acquire {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ propagate_acquire_katcp(struct katcp_dispatch *,
                                           struct katcp_acquire *);
int set_value_discrete_katcp(struct katcp_acquire *, unsigned int);
int set_discrete_acquire_katcp(struct katcp_dispatch *d,
                               struct katcp_acquire *a, unsigned value) {
  int result;
  result = set_value_discrete_katcp(a, value);
  propagate_acquire_katcp(d, a);
  return result;
}


x86 assembly (clang, -O0):
<set_discrete_acquire_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <set_value_discrete_katcp@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <propagate_acquire_katcp@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_discrete_acquire_katcp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <set_value_discrete_katcp@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <propagate_acquire_katcp@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
%struct.katcp_acquire = type { i32 }
define i32 @set_discrete_acquire_katcp(%struct.katcp_dispatch* %0, %struct.katcp_acquire* %1, i32 %2) {
%4 = alloca %struct.katcp_dispatch*
%5 = alloca %struct.katcp_acquire*
%6 = alloca i32
%7 = alloca i32
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %4
store %struct.katcp_acquire* %1, %struct.katcp_acquire** %5
store i32 %2, i32* %6
%8 = load %struct.katcp_acquire*, %struct.katcp_acquire** %5
%9 = load i32, i32* %6
%10 = call i32 @set_value_discrete_katcp(%struct.katcp_acquire* %8, i32 %9)
store i32 %10, i32* %7
%11 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %4
%12 = load %struct.katcp_acquire*, %struct.katcp_acquire** %5
%13 = call i32 @propagate_acquire_katcp(%struct.katcp_dispatch* %11, %struct.katcp_acquire* %12)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
%struct.katcp_acquire = type { i32 }
define i32 @set_discrete_acquire_katcp(%struct.katcp_dispatch* %0, %struct.katcp_acquire* %1, i32 %2) {
%4 = tail call i32 @set_value_discrete_katcp(%struct.katcp_acquire* %1, i32 %2)
%5 = tail call i32 @propagate_acquire_katcp(%struct.katcp_dispatch* %0, %struct.katcp_acquire* %1)
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *small_calloc(size_t s, size_t c) {
  s *= c;
  void *p = malloc(s);
  if (p) {
    memset(p, 0, s);
  }
  return p;
}


x86 assembly (clang, -O0):
<small_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <small_calloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <small_calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @small_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = mul i64 %7, %6
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i64, i64* %3
%16 = call i32 @memset(i8* %14, i32 0, i64 %15)
br label %17
17: ; preds = %13, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @small_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvins_wstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvins_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvins_wstr+0x2a>
jmp    1170 <cmd_mvins_wstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvins_wstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvins_wstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvins_wstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvins_wstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
int foo() {
  int a = 5;
  int b = a;
  a = b;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void pre_user() { write("ganttproject.gan", "\t\t<resource", NULL); }


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

x86 assembly (clang, -O2):
<pre_user>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [12 x i8] c"\09\09<resource\00"
define void @pre_user() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [12 x i8] c"\09\09<resource\00"
define void @pre_user() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}