xunge/DecIR huggingface dataset:
unsigned short getIndentation(const char *line) {
  unsigned short nbFirstSpaces;
  for (nbFirstSpaces = 0;
       line[nbFirstSpaces] == ' ' || line[nbFirstSpaces] == '\t';
       nbFirstSpaces++)
    ;
  return nbFirstSpaces;
}


x86 assembly (clang, -O0):
<getIndentation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzwl -0xa(%rbp),%ecx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xb(%rbp)
je     113d <getIndentation+0x3d>
mov    -0x8(%rbp),%rax
movzwl -0xa(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
test   $0x1,%al
jne    114d <getIndentation+0x4d>
jmp    1163 <getIndentation+0x63>
jmp    1152 <getIndentation+0x52>
mov    -0xa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa(%rbp)
jmp    110e <getIndentation+0xe>
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndentation>:
xor    %eax,%eax
jmp    1113 <getIndentation+0x13>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
movzwl %ax,%ecx
movzbl (%rdi,%rcx,1),%ecx
cmp    $0x20,%cl
je     1110 <getIndentation+0x10>
cmp    $0x9,%cl
je     1110 <getIndentation+0x10>
ret

LLVM IR (-O0):
define zeroext i16 @getIndentation(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %3
br label %4
4: ; preds = %23, %1
%5 = load i8*, i8** %2
%6 = load i16, i16* %3
%7 = zext i16 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %20, label %12
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i16, i16* %3
%15 = zext i16 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 9
br label %20
20: ; preds = %12, %4
%21 = phi i1 [ true, %4 ], [ %19, %12 ]
br i1 %21, label %22, label %26
22: ; preds = %20
br label %23
23: ; preds = %22
%24 = load i16, i16* %3
%25 = add i16 %24, 1
store i16 %25, i16* %3
br label %4
26: ; preds = %20
%27 = load i16, i16* %3
ret i16 %27
}

LLVM IR (-O2):
define zeroext i16 @getIndentation(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i16 [ 0, %1 ], [ %8, %7 ]
%4 = zext i16 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 32, label %7
i8 9, label %7
]
7: ; preds = %2, %2
%8 = add i16 %3, 1
br label %2
9: ; preds = %2
ret i16 %3
}
float Sleef_logf_u35(float x) { return __builtin_logf(x); }


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

x86 assembly (clang, -O2):
<Sleef_logf_u35>:
jmp    1030 <logf@plt>

LLVM IR (-O0):
define float @Sleef_logf_u35(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Sleef_logf_u35(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
/* Variables and functions */
double fabsk(double);
__attribute__((always_)) const int xisodd(double d) {
  double x = d - (double)(1LL << 31) * (int)(d * (1.0 / (1LL << 31)));
  return (1 & (int)x) != 0 && fabsk(d) < (double)(1LL << 53);
}


x86 assembly (clang, -O0):
<xisodd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1181 <xisodd+0x71>
movsd  -0x8(%rbp),%xmm0
call   1030 <fabsk@plt>
movaps %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisodd>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  0xedb(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ecx
xor    %eax,%eax
test   $0x1,%cl
je     1152 <xisodd+0x42>
call   1030 <fabsk@plt>
movsd  0xec7(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xisodd(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 0x3E00000000000000
%7 = fptosi double %6 to i32
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double 0xC1E0000000000000, double %8, double %4)
store double %9, double* %3
%10 = load double, double* %3
%11 = fptosi double %10 to i32
%12 = and i32 1, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %1
%15 = load double, double* %2
%16 = call double @fabsk(double %15)
%17 = fcmp olt double %16, 0x4340000000000000
br label %18
18: ; preds = %14, %1
%19 = phi i1 [ false, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @xisodd(double %0) {
%2 = fmul double %0, 0x3E00000000000000
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0xC1E0000000000000, double %0)
%6 = fptosi double %5 to i32
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = tail call double @fabsk(double %0)
%11 = fcmp olt double %10, 0x4340000000000000
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ 0, %1 ], [ %12, %9 ]
ret i32 %14
}
double read_DCS8Number(char *p) {
  unsigned int rv;
  rv = (unsigned int)((unsigned char *)p)[0];
  return (double)rv / 255.0;
}


x86 assembly (clang, -O0):
<read_DCS8Number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_DCS8Number>:
movzbl (%rdi),%eax
cvtsi2sd %eax,%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @read_DCS8Number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = uitofp i32 %8 to double
%10 = fdiv double %9, 2.550000e+02
ret double %10
}

LLVM IR (-O2):
define double @read_DCS8Number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = uitofp i8 %2 to double
%4 = fdiv double %3, 2.550000e+02
ret double %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef int int64_t;

/* Variables and functions */
int64_t __hsail_bitinsert_u64(uint64_t src0, uint64_t src1, uint32_t src2,
                              uint32_t src3) {
  uint32_t offset = src2 & (sizeof(uint64_t) * 8 - 1);
  uint32_t width = src3 & (sizeof(uint64_t) * 8 - 1);
  uint64_t mask = ((uint64_t)1 << width) - 1;
  return (src0 & ~(mask << offset)) | ((src1 & mask) << offset);
}


x86 assembly (clang, -O0):
<__hsail_bitinsert_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movslq -0xc(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0x14(%rbp)
movslq -0x10(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%edx
and    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_bitinsert_u64>:
mov    %edx,%r8d
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %eax,%edx
mov    %r8d,%ecx
shl    %cl,%edx
not    %edx
and    %edi,%edx
and    %esi,%eax
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @__hsail_bitinsert_u64(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = and i64 %13, 31
%15 = trunc i64 %14 to i32
store i32 %15, i32* %9
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = and i64 %17, 31
%19 = trunc i64 %18 to i32
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = shl i32 1, %20
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %11
%23 = load i32, i32* %5
%24 = load i32, i32* %11
%25 = load i32, i32* %9
%26 = shl i32 %24, %25
%27 = xor i32 %26, -1
%28 = and i32 %23, %27
%29 = load i32, i32* %6
%30 = load i32, i32* %11
%31 = and i32 %29, %30
%32 = load i32, i32* %9
%33 = shl i32 %31, %32
%34 = or i32 %28, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @__hsail_bitinsert_u64(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, 31
%6 = and i32 %3, 31
%7 = shl nsw i32 -1, %6
%8 = xor i32 %7, -1
%9 = shl i32 %8, %5
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = and i32 %8, %1
%13 = shl i32 %12, %5
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
struct ylist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct ylist_head *);
int /*<<< orphan*/ ylist_add(struct ylist_head *, struct ylist_head *);
void ylist_move(struct ylist_head *list, struct ylist_head *head) {
  __list_del_entry(list);
  ylist_add(list, head);
}


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

x86 assembly (clang, -O2):
<ylist_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ylist_add@plt>

LLVM IR (-O0):
%struct.ylist_head = type { i32 }
define void @ylist_move(%struct.ylist_head* %0, %struct.ylist_head* %1) {
%3 = alloca %struct.ylist_head*
%4 = alloca %struct.ylist_head*
store %struct.ylist_head* %0, %struct.ylist_head** %3
store %struct.ylist_head* %1, %struct.ylist_head** %4
%5 = load %struct.ylist_head*, %struct.ylist_head** %3
%6 = call i32 @__list_del_entry(%struct.ylist_head* %5)
%7 = load %struct.ylist_head*, %struct.ylist_head** %3
%8 = load %struct.ylist_head*, %struct.ylist_head** %4
%9 = call i32 @ylist_add(%struct.ylist_head* %7, %struct.ylist_head* %8)
ret void
}

LLVM IR (-O2):
%struct.ylist_head = type { i32 }
define void @ylist_move(%struct.ylist_head* %0, %struct.ylist_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.ylist_head* %0)
%4 = tail call i32 @ylist_add(%struct.ylist_head* %0, %struct.ylist_head* %1)
ret void
}
float v4dot(const float *v1, const float *v2) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2] + v1[3] * v2[3];
}


x86 assembly (clang, -O0):
<v4dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4dot>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm2
mulss  0x8(%rsi),%xmm2
addss  %xmm1,%xmm2
movss  0xc(%rdi),%xmm0
mulss  0xc(%rsi),%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @v4dot(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 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 3
%28 = load float, float* %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 3
%31 = load float, float* %30
%32 = call float @llvm.fmuladd.f32(float %28, float %31, float %25)
ret float %32
}

LLVM IR (-O2):
define float @v4dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
%16 = getelementptr inbounds float, float* %0, i64 3
%17 = load float, float* %16
%18 = getelementptr inbounds float, float* %1, i64 3
%19 = load float, float* %18
%20 = tail call float @llvm.fmuladd.f32(float %17, float %19, float %15)
ret float %20
}
unsigned char uint_bytes_follow(unsigned char additional_info) {
  if (additional_info < 24 || additional_info > 27) {
    return 0;
  }
  static const unsigned char BYTES_FOLLOW[] = {1, 2, 4, 8};
  return BYTES_FOLLOW[additional_info - 24];
}


x86 assembly (clang, -O0):
<uint_bytes_follow>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x18,%eax
jl     1124 <uint_bytes_follow+0x24>
movzbl -0x2(%rbp),%eax
cmp    $0x1b,%eax
jle    112d <uint_bytes_follow+0x2d>
movb   $0x0,-0x1(%rbp)
jmp    1144 <uint_bytes_follow+0x44>
movzbl -0x2(%rbp),%eax
sub    $0x18,%eax
movslq %eax,%rcx
lea    0xec2(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_bytes_follow>:
lea    -0x1c(%rdi),%eax
cmp    $0xfc,%al
jae    110a <uint_bytes_follow+0xa>
xor    %eax,%eax
ret
movzbl %dil,%eax
add    $0xffffffe8,%eax
lea    0xee8(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@uint_bytes_follow.BYTES_FOLLOW = internal constant [4 x i8] c"\01\02\04\08"
define zeroext i8 @uint_bytes_follow(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 24
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sgt i32 %9, 27
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 0, i8* %2
br label %19
12: ; preds = %7
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = sub nsw i32 %14, 24
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [4 x i8], [4 x i8]* @uint_bytes_follow.BYTES_FOLLOW, i64 0, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %2
br label %19
19: ; preds = %12, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
@uint_bytes_follow.BYTES_FOLLOW = internal unnamed_addr constant [4 x i8] c"\01\02\04\08"
define zeroext i8 @uint_bytes_follow(i8 zeroext %0) {
%2 = add i8 %0, -28
%3 = icmp ult i8 %2, -4
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = zext i8 %0 to i64
%6 = add nuw nsw i64 %5, 4294967272
%7 = and i64 %6, 4294967295
%8 = getelementptr inbounds [4 x i8], [4 x i8]* @uint_bytes_follow.BYTES_FOLLOW, i64 0, i64 %7
%9 = load i8, i8* %8
br label %10
10: ; preds = %1, %4
%11 = phi i8 [ %9, %4 ], [ 0, %1 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _list_simple_free_fn(void *data) { free(data); }


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

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

LLVM IR (-O2):
define void @_list_simple_free_fn(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int printk_ratelimit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @printk_ratelimit() {
ret i32 0
}
unsigned long get_syscfg_reg(int port) { return port == 0 ? 0x00 : 0x02; }


x86 assembly (clang, -O0):
<get_syscfg_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_syscfg_reg>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %rax,%rax
ret

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

LLVM IR (-O2):
define i64 @get_syscfg_reg(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i64 0, i64 2
ret i64 %3
}
/* Variables and functions */
int strlen(char *);
int str_clear(char str[]) {
  int err = 0;
  int i;
  int str_length = strlen(str);
  for (i = 0; i <= str_length; str[i++] = '\0')
    ;
  return err;
}


x86 assembly (clang, -O0):
<str_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1162 <str_clear+0x52>
jmp    1147 <str_clear+0x37>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1136 <str_clear+0x26>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_clear>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
js     113d <str_clear+0x1d>
mov    %eax,%edx
add    $0x1,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @str_clear(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = add nuw nsw i64 %5, 1
br label %7
7: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FlashWrite(int, int);
void FlashUnlockBypassReset(void) {
  FlashWrite((0x0), (0x0090));
  FlashWrite((0x0), (0x0000));
}


x86 assembly (clang, -O0):
<FlashUnlockBypassReset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x90,%esi
call   1030 <FlashWrite@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <FlashWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUnlockBypassReset>:
push   %rax
xor    %edi,%edi
mov    $0x90,%esi
call   1030 <FlashWrite@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <FlashWrite@plt>

LLVM IR (-O0):
define void @FlashUnlockBypassReset() {
%1 = call i32 @FlashWrite(i32 0, i32 144)
%2 = call i32 @FlashWrite(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @FlashUnlockBypassReset() {
%1 = tail call i32 @FlashWrite(i32 0, i32 144)
%2 = tail call i32 @FlashWrite(i32 0, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ gen_tempname(char *);
char *mkdtemp(char *template) {
  if (gen_tempname(template))
    return NULL;
  else
    return template;
}


x86 assembly (clang, -O0):
<mkdtemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gen_tempname@plt>
cmp    $0x0,%rax
je     113c <mkdtemp+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1144 <mkdtemp+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdtemp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <gen_tempname@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @mkdtemp(i8* %0) {
%2 = tail call i64 @gen_tempname(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* %0, i8* null
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ *tlv_find_param(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ tlv_get_length(int /*<<< orphan*/ *);
uint8_t *tlv_find_data(uint8_t *p_tlv, uint16_t i_type, uint16_t n,
                       uint16_t *pi_length) {
  uint8_t *p_tlv_n = tlv_find_param(p_tlv, i_type, n);
  *pi_length = tlv_get_length(p_tlv_n);
  return p_tlv_n + 4;
}


x86 assembly (clang, -O0):
<tlv_find_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <tlv_find_param@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <tlv_get_length@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x10,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlv_find_data>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
call   1030 <tlv_find_param@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <tlv_get_length@plt>
mov    %eax,(%r14)
add    $0x10,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @tlv_find_data(i32* %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = tail call i32* @tlv_find_param(i32* %0, i32 %1, i32 %2)
%6 = tail call i32 @tlv_get_length(i32* %5)
store i32 %6, i32* %3
%7 = getelementptr inbounds i32, i32* %5, i64 4
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ a();
void b() { a(); }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <a@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @b() {
%1 = call i32 (...) @a()
ret void
}

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @a()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_putch(char const);
void lcd_putstr(const char *data) {
  unsigned char i = 0;
  while (data[i] != 0 && i < 255) {
    lcd_putch(data[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<lcd_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl -0x9(%rbp),%ecx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1149 <lcd_putstr+0x39>
movzbl -0x9(%rbp),%eax
cmp    $0xff,%eax
setl   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1159 <lcd_putstr+0x49>
jmp    1177 <lcd_putstr+0x67>
mov    -0x8(%rbp),%rax
movzbl -0x9(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <lcd_putch@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1120 <lcd_putstr+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_putstr>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1151 <lcd_putstr+0x41>
mov    %rdi,%r14
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <lcd_putch@plt>
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     1151 <lcd_putstr+0x41>
lea    0x1(%rbx),%rcx
cmp    $0xff,%rbx
mov    %rcx,%rbx
jne    1130 <lcd_putstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @lcd_putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
br label %4
4: ; preds = %18, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %3
%7 = zext i8 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp slt i32 %14, 255
br label %16
16: ; preds = %12, %4
%17 = phi i1 [ false, %4 ], [ %15, %12 ]
br i1 %17, label %18, label %27
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = load i8, i8* %3
%21 = zext i8 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = call i32 @lcd_putch(i8 signext %23)
%25 = load i8, i8* %3
%26 = add i8 %25, 1
store i8 %26, i8* %3
br label %4
27: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @lcd_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @lcd_putch(i8 signext %6)
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
%12 = icmp ne i64 %8, 255
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %4, label %14
14: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ short_sleep(int);
void wait_for_flag(volatile int *pflag, int mask) {
  while (!(*pflag & mask))
    short_sleep(10000);
}


x86 assembly (clang, -O0):
<wait_for_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113d <wait_for_flag+0x2d>
jmp    114c <wait_for_flag+0x3c>
mov    $0x2710,%edi
call   1030 <short_sleep@plt>
jmp    111f <wait_for_flag+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_flag>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%eax
and    %esi,%eax
jne    1130 <wait_for_flag+0x20>
mov    %esi,%ebp
mov    %rdi,%rbx
xchg   %ax,%ax
mov    $0x2710,%edi
call   1030 <short_sleep@plt>
mov    (%rbx),%eax
and    %ebp,%eax
je     1120 <wait_for_flag+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @wait_for_flag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %12, %2
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %14
12: ; preds = %5
%13 = call i32 @short_sleep(i32 10000)
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wait_for_flag(i32* %0, i32 %1) {
%3 = load volatile i32, i32* %0
%4 = and i32 %3, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = tail call i32 @short_sleep(i32 10000)
%8 = load volatile i32, i32* %0
%9 = and i32 %8, %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ bomb(char *);
extern pid_t waitpid(pid_t pid, int *stat_loc, int options) { bomb("waitpid"); }


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <bomb@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"waitpid\00"
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = call i32 @bomb(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"waitpid\00"
define i32 @waitpid(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @bomb(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int find(int *, int);
int test_negative_elements() {
  int array[] = {-2, 5, 8, -5, -2, -2, 8, 5, 5, 8};
  return -5 == find(array, 10);
}


x86 assembly (clang, -O0):
<test_negative_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <find@plt>
mov    %eax,%ecx
mov    $0xfffffffb,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_negative_elements>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <find@plt>
xor    %ecx,%ecx
cmp    $0xfffffffb,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_negative_elements.array = [10 x i32] [i32 -2, i32 5, i32 8, i32 -5, i32 -2, i32 -2, i32 8, i32 5, i32 5, i32 8]
define i32 @test_negative_elements() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 10)
%5 = icmp eq i32 -5, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_negative_elements.array = [10 x i32] [i32 -2, i32 5, i32 8, i32 -5, i32 -2, i32 -2, i32 8, i32 5, i32 5, i32 8]
define i32 @test_negative_elements() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 10)
%5 = icmp eq i32 %4, -5
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int fn_test(register unsigned m) {
  register unsigned i;
  for (i = 0; i < m; i++)
    printf("%d ", i);
  printf("\n");
  return i;
}


x86 assembly (clang, -O0):
<fn_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    114d <fn_test+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <fn_test+0x12>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_test>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
je     1153 <fn_test+0x33>
lea    0xecf(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <fn_test+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @fn_test(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret i32 %0
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSNLS(const char *the_title) { return any_decrqss(the_title, "*|"); }


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

x86 assembly (clang, -O2):
<rpt_DECSNLS>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"*|\00"
define i32 @rpt_DECSNLS(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"*|\00"
define i32 @rpt_DECSNLS(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
struct shl_htable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ shl_htable_clear(struct shl_htable *,
                                    void (*)(void *, void *), void *);
void shl_htable_clear_ulong(struct shl_htable *htable,
                            void (*cb)(unsigned long *elem, void *ctx),
                            void *ctx) {
  shl_htable_clear(htable, (void (*)(void *, void *))cb, ctx);
}


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

x86 assembly (clang, -O2):
<shl_htable_clear_ulong>:
jmp    1030 <shl_htable_clear@plt>

LLVM IR (-O0):
%struct.shl_htable = type { i32 }
define void @shl_htable_clear_ulong(%struct.shl_htable* %0, void (i64*, i8*)* %1, i8* %2) {
%4 = alloca %struct.shl_htable*
%5 = alloca void (i64*, i8*)*
%6 = alloca i8*
store %struct.shl_htable* %0, %struct.shl_htable** %4
store void (i64*, i8*)* %1, void (i64*, i8*)** %5
store i8* %2, i8** %6
%7 = load %struct.shl_htable*, %struct.shl_htable** %4
%8 = load void (i64*, i8*)*, void (i64*, i8*)** %5
%9 = bitcast void (i64*, i8*)* %8 to void (i8*, i8*)*
%10 = load i8*, i8** %6
%11 = call i32 @shl_htable_clear(%struct.shl_htable* %7, void (i8*, i8*)* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.shl_htable = type { i32 }
define void @shl_htable_clear_ulong(%struct.shl_htable* %0, void (i64*, i8*)* %1, i8* %2) {
%4 = bitcast void (i64*, i8*)* %1 to void (i8*, i8*)*
%5 = tail call i32 @shl_htable_clear(%struct.shl_htable* %0, void (i8*, i8*)* %4, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t checkTimer() {
  time_t current_time = time(NULL);
  return current_time;
}


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

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

LLVM IR (-O0):
define i32 @checkTimer() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @checkTimer() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
int lcd(int u, int v, int h) { return (u * v / h); }


x86 assembly (clang, -O0):
<lcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @lcd(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 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = sdiv i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcd(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = sdiv i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ xmm_free(void *, size_t);
void *xmm_mnew(size_t);
void *xmm_mrenew(void *old, size_t old_size, size_t new_size) {
  xmm_free(old, old_size);
  return xmm_mnew(new_size);
}


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

x86 assembly (clang, -O2):
<xmm_mrenew>:
push   %rbx
mov    %rdx,%rbx
call   1030 <xmm_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xmm_mnew@plt>

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

LLVM IR (-O2):
define i8* @xmm_mrenew(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @xmm_free(i8* %0, i64 %1)
%5 = tail call i8* @xmm_mnew(i64 %2)
ret i8* %5
}
int foo(int j) {
  int i;
  int sum = 0;
  for (i = 1; i < j; i += i)
    sum += i / 16;
  return sum;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1140 <foo+0x40>
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <foo+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1123 <foo+0x23>
mov    $0x1,%ecx
xor    %eax,%eax
xchg   %ax,%ax
lea    0xf(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
sar    $0x4,%edx
add    %edx,%eax
add    %ecx,%ecx
cmp    %edi,%ecx
jl     1110 <foo+0x10>
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 1, %1 ]
%6 = sdiv i32 %5, 16
%7 = add nsw i32 %4, %6
%8 = shl nsw i32 %5, 1
%9 = icmp slt i32 %8, %0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ anykey();
int /*<<< orphan*/ display_itemlist();
int /*<<< orphan*/ screen_load();
int /*<<< orphan*/ screen_save();
void do_cmd_itemlist(void) {
  screen_save();
  display_itemlist();
  anykey();
  screen_load();
}


x86 assembly (clang, -O0):
<do_cmd_itemlist>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <screen_save@plt>
mov    $0x0,%al
call   1040 <display_itemlist@plt>
mov    $0x0,%al
call   1050 <anykey@plt>
mov    $0x0,%al
call   1030 <screen_load@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_itemlist>:
push   %rax
xor    %eax,%eax
call   1060 <screen_save@plt>
xor    %eax,%eax
call   1040 <display_itemlist@plt>
xor    %eax,%eax
call   1050 <anykey@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <screen_load@plt>

LLVM IR (-O0):
define void @do_cmd_itemlist() {
%1 = call i32 (...) @screen_save()
%2 = call i32 (...) @display_itemlist()
%3 = call i32 (...) @anykey()
%4 = call i32 (...) @screen_load()
ret void
}

LLVM IR (-O2):
define void @do_cmd_itemlist() {
%1 = tail call i32 (...) @screen_save()
%2 = tail call i32 (...) @display_itemlist()
%3 = tail call i32 (...) @anykey()
%4 = tail call i32 (...) @screen_load()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprint_vector(int /*<<< orphan*/, char *, double const *,
                                 int const);
int /*<<< orphan*/ stdout;
void PrintVector(const double *x, const int n) {
  fprint_vector(stdout, " ", x, n);
}


x86 assembly (clang, -O0):
<PrintVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rsi
call   1030 <fprint_vector@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintVector>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprint_vector@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c" \00"
define void @PrintVector(double* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprint_vector(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), double* %0, i32 %1)
ret void
}
char *strdup(str) const char *str;
{
  char *newstr;
  newstr = (char *)malloc(strlen(str) + 1);
  if (newstr)
    strcpy(newstr, str);
  return newstr;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
int test_imm_94uint16_reg(unsigned short val) {
  return ((val) & (-0x94 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_94uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff6c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_94uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -148
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void repnz_ret() { asm("repnz; ret"); }


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

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

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

LLVM IR (-O2):
define void @repnz_ret() {
tail call void asm sideeffect "repnz; ret", "~{dirflag},~{fpsr},~{flags}"()
ret void
}