xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *thr_fn1(void *arg) {
  printf("thread 1 returning\n");
  sleep(3);
  return (void *)1000;
}


x86 assembly (clang, -O0):
<thr_fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    $0x3e8,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    $0x3e8,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"thread 1 returning\0A\00"
define i8* @thr_fn1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 3)
ret i8* inttoptr (i64 1000 to i8*)
}

LLVM IR (-O2):
@str = [19 x i8] c"thread 1 returning\00"
define i8* @thr_fn1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 3)
ret i8* inttoptr (i64 1000 to i8*)
}
void instruc_25() {}


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

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

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

LLVM IR (-O2):
define void @instruc_25() {
ret void
}
double scale_h1(double x, double y, double z) { return 1.0; }


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

x86 assembly (clang, -O2):
<scale_h1>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @scale_h1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @scale_h1(double %0, double %1, double %2) {
ret double 1.000000e+00
}
/* Type definitions */
struct rtattr {
  int dummy;
};

/* Variables and functions */
scalar_t__ RTA_DATA(struct rtattr const *);
const char *rta_getattr_str(const struct rtattr *rta) {
  return (const char *)RTA_DATA(rta);
}


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

x86 assembly (clang, -O2):
<rta_getattr_str>:
jmp    1030 <RTA_DATA@plt>

LLVM IR (-O0):
%struct.rtattr = type { i32 }
define i8* @rta_getattr_str(%struct.rtattr* %0) {
%2 = alloca %struct.rtattr*
store %struct.rtattr* %0, %struct.rtattr** %2
%3 = load %struct.rtattr*, %struct.rtattr** %2
%4 = call i64 @RTA_DATA(%struct.rtattr* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i8* @rta_getattr_str(%struct.rtattr* %0) {
%2 = tail call i64 @RTA_DATA(%struct.rtattr* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void outc(c) int c;
{ putchar(c); }


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

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

LLVM IR (-O0):
define void @outc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @outc(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Type definitions */
struct mt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mt *);
void mt_free(struct mt *self) { free(self); }


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

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

LLVM IR (-O2):
%struct.mt = type { i32 }
define void @mt_free(%struct.mt* nocapture %0) {
%2 = tail call i32 @free(%struct.mt* %0)
ret void
}
int _XMP_ceili(int a, int b) {
  int div = a / b;
  if ((a < 0) || (b < 0)) {
    return div;
  } else {
    if ((a % b) == 0) {
      return div;
    } else {
      return div + 1;
    }
  }
}


x86 assembly (clang, -O0):
<_XMP_ceili>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1128 <_XMP_ceili+0x28>
cmpl   $0x0,-0xc(%rbp)
jge    1133 <_XMP_ceili+0x33>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <_XMP_ceili+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114e <_XMP_ceili+0x4e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <_XMP_ceili+0x57>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XMP_ceili>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
mov    %eax,%ecx
sbb    $0xffffffff,%ecx
or     %edi,%esi
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_XMP_ceili(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sdiv i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12, %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %27
17: ; preds = %12
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = load i32, i32* %6
store i32 %23, i32* %3
br label %27
24: ; preds = %17
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %22, %15
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @_XMP_ceili(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = or i32 %1, %0
%6 = icmp sgt i32 %5, -1
%7 = icmp ne i32 %4, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %3, %8
%10 = select i1 %6, i32 %9, i32 %3
ret i32 %10
}
/* Type definitions */
struct power_section {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct power_section *);
void power_free(void *data) {
  struct power_section *section = data;
  free(section);
}


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

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

LLVM IR (-O0):
%struct.power_section = type { i32 }
define void @power_free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.power_section*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.power_section*
store %struct.power_section* %5, %struct.power_section** %3
%6 = load %struct.power_section*, %struct.power_section** %3
%7 = call i32 @free(%struct.power_section* %6)
ret void
}

LLVM IR (-O2):
%struct.power_section = type { i32 }
define void @power_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.power_section*
%3 = tail call i32 @free(%struct.power_section* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
void sort(int a[], int len) {
  if (len > 1)
    qsort(a, 0, len - 1);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    113a <sort+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <qsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x2,%esi
jl     1121 <sort+0x11>
mov    %esi,%edx
add    $0xffffffff,%edx
xor    %esi,%esi
jmp    1030 <qsort@plt>
ret

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

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = tail call i32 @qsort(i32* %0, i32 0, i32 %5)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
bool is_whitespace(char c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_whitespace+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_help(int status) {
  printf("Usage: img-merge <snapshot device> <cow file> <image file>\n");
  exit(status);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: img-merge <snapshot device> <cow file> <image file>\0A\00"
define void @print_help(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [59 x i8] c"Usage: img-merge <snapshot device> <cow file> <image file>\00"
define void @print_help(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_min_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi16(int /*<<< orphan*/);
__m128i x265_m8s_min_m8s_int32(__m128i a, int32_t i) {
  __m128i b;
  b = _mm_set1_epi16(i);
  return _mm_min_epi16(a, b);
}


x86 assembly (clang, -O0):
<x265_m8s_min_m8s_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_mm_set1_epi16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <_mm_min_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x265_m8s_min_m8s_int32>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <_mm_set1_epi16@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <_mm_min_epi16@plt>

LLVM IR (-O0):
define i32 @x265_m8s_min_m8s_int32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @_mm_set1_epi16(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = call i32 @_mm_min_epi16(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @x265_m8s_min_m8s_int32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_set1_epi16(i32 %1)
%4 = tail call i32 @_mm_min_epi16(i32 %0, i32 %3)
ret i32 %4
}
int f1(int i) {
  if (i == 10) {
    __builtin_trap();
    return 0;
  }
  return f1(++i);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1133 <f1+0x23>
ud2
movl   $0x0,-0x4(%rbp)
jmp    1144 <f1+0x34>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x8(%rbp)
call   1030 <f1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
ud2

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
tail call void @llvm.trap()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printArray(void *arr, int arrLen) {
  for (int i = 0; i < arrLen; i++) {
    printf("%c", *((char *)arr + i));
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <printArray+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <printArray+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printArray(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void flush(void) {
  while ((*(volatile unsigned char *)0x101FB018) & (1 << 3))
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0x101fb018,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     113b <flush+0x2b>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
testb  $0x8,0x101fb018
08
je     1131 <flush+0x21>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x8,0x101fb018
08
jne    1120 <flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i8, i8* inttoptr (i64 270512152 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @barrier()
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
%1 = load volatile i8, i8* inttoptr (i64 270512152 to i8*)
%2 = and i8 %1, 8
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @barrier()
%6 = load volatile i8, i8* inttoptr (i64 270512152 to i8*)
%7 = and i8 %6, 8
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret void
}
int f2(int a) { return ++a; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_int(char);
int /*<<< orphan*/ print_string(char *);
void foo(char y) {
  print_int(y);
  print_string("\n");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <print_int@plt>
lea    0xec2(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1040 <print_int@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @foo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @print_int(i8 signext %3)
%5 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @foo(i8 signext %0) {
%2 = tail call i32 @print_int(i8 signext %0)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long __udivmoddi4(unsigned long long, unsigned long long,
                                int /*<<< orphan*/);
int /*<<< orphan*/ printk(char *, unsigned long long, unsigned long long);
unsigned long long __udivdi3(unsigned long long num, unsigned long long den) {
  printk("%d,%d\n", num, den);
  return __udivmoddi4(num, den, 0);
}


x86 assembly (clang, -O0):
<__udivdi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printk@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <__udivmoddi4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__udivdi3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printk@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__udivmoddi4@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
define i64 @__udivdi3(i64 %0, i64 %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%4 = tail call i64 @__udivmoddi4(i64 %0, i64 %1, i32 0)
ret i64 %4
}
/* Type definitions */
struct pkt_buff {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ dissect_routinghdr_type_0(struct pkt_buff *,
                                             int /*<<< orphan*/ *, int);
void dissect_routinghdr_type_0_less(struct pkt_buff *pkt, ssize_t *data_len) {
  dissect_routinghdr_type_0(pkt, data_len, 1);
}


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

x86 assembly (clang, -O2):
<dissect_routinghdr_type_0_less>:
mov    $0x1,%edx
jmp    1030 <dissect_routinghdr_type_0@plt>

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
define void @dissect_routinghdr_type_0_less(%struct.pkt_buff* %0, i32* %1) {
%3 = alloca %struct.pkt_buff*
%4 = alloca i32*
store %struct.pkt_buff* %0, %struct.pkt_buff** %3
store i32* %1, i32** %4
%5 = load %struct.pkt_buff*, %struct.pkt_buff** %3
%6 = load i32*, i32** %4
%7 = call i32 @dissect_routinghdr_type_0(%struct.pkt_buff* %5, i32* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
define void @dissect_routinghdr_type_0_less(%struct.pkt_buff* %0, i32* %1) {
%3 = tail call i32 @dissect_routinghdr_type_0(%struct.pkt_buff* %0, i32* %1, i32 1)
ret void
}
double frac(double x) {
  x -= (int)x;
  return ((x < 0) ? x + 1.0 : x);
}


x86 assembly (clang, -O0):
<frac>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1145 <frac+0x45>
movsd  0xeca(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114f <frac+0x4f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frac>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xeec(%rip),%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @frac(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = fsub double %6, %5
store double %7, double* %2
%8 = load double, double* %2
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %2
%12 = fadd double %11, 1.000000e+00
br label %15
13: ; preds = %1
%14 = load double, double* %2
br label %15
15: ; preds = %13, %10
%16 = phi double [ %12, %10 ], [ %14, %13 ]
ret double %16
}

LLVM IR (-O2):
define double @frac(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fcmp olt double %4, 0.000000e+00
%6 = fadd double %4, 1.000000e+00
%7 = select i1 %5, double %6, double %4
ret double %7
}
/* Variables and functions */
void bar_alias();
__attribute__((__always___)) void bar(void) { return bar_alias(); }


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

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

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

LLVM IR (-O2):
define void @bar() {
tail call void (...) @bar_alias()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xcolormap_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xcolormap.serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xcolormap_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xcolormap_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
__attribute__((always_)) void flush_icache_range(unsigned long start,
                                                 unsigned long end) {}


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

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

LLVM IR (-O0):
define void @flush_icache_range(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @flush_icache_range(i64 %0, i64 %1) {
ret void
}
/* Type definitions */
struct xmms_convert_buffers {
  int dummy;
};

/* Variables and functions */
int convert_mono_to_stereo(struct xmms_convert_buffers *, void **, int, int);
int convert_mono_to_stereo_16(struct xmms_convert_buffers *buf, void **data,
                              int length) {
  return convert_mono_to_stereo(buf, data, length, (!(0)));
}


x86 assembly (clang, -O0):
<convert_mono_to_stereo_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <convert_mono_to_stereo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_mono_to_stereo_16>:
mov    $0x1,%ecx
jmp    1030 <convert_mono_to_stereo@plt>

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

LLVM IR (-O2):
%struct.xmms_convert_buffers = type { i32 }
define i32 @convert_mono_to_stereo_16(%struct.xmms_convert_buffers* %0, i8** %1, i32 %2) {
%4 = tail call i32 @convert_mono_to_stereo(%struct.xmms_convert_buffers* %0, i8** %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ttargbyte(char *dst, char *src) {
  printf("test C argbyte\n");
  printf("dst:%s,src:%s\n", dst, src);
}


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

x86 assembly (clang, -O2):
<ttargbyte>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"test C argbyte\0A\00"
@.str.1 = [15 x i8] c"dst:%s,src:%s\0A\00"
define void @ttargbyte(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"dst:%s,src:%s\0A\00"
@str = [15 x i8] c"test C argbyte\00"
define void @ttargbyte(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t minipack_unpack_map16(void *ptr, size_t *sz) {
  *sz = 3;
  return ntohs(*((uint16_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_map16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_map16>:
movq   $0x3,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @minipack_unpack_map16(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 3, i64* %5
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 1
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @ntohs(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @minipack_unpack_map16(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 3, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fun(int, char const);
int input();
void main() {
  const char useless2 = 'u';
  int a;
  a = input();
  fun(a, useless2);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x75,-0x1(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x75,%esi
call   1040 <fun@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%edi
mov    $0x75,%esi
pop    %rax
jmp    1040 <fun@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8
%2 = alloca i32
store i8 117, i8* %1
%3 = call i32 (...) @input()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fun(i32 %4, i8 signext 117)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @input()
%2 = tail call i32 @fun(i32 %1, i8 signext 117)
ret void
}
/* Type definitions */
struct cart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cartVarDbName(char *, char *);
double cartDouble(struct cart *, int /*<<< orphan*/);
double cartDoubleDb(struct cart *cart, char *db, char *var) {
  return cartDouble(cart, _cartVarDbName(db, var));
}


x86 assembly (clang, -O0):
<cartDoubleDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_cartVarDbName@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <cartDouble@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cartDoubleDb>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <_cartVarDbName@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <cartDouble@plt>

LLVM IR (-O0):
%struct.cart = type { i32 }
define double @cartDoubleDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cart*
%5 = alloca i8*
%6 = alloca i8*
store %struct.cart* %0, %struct.cart** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.cart*, %struct.cart** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @_cartVarDbName(i8* %8, i8* %9)
%11 = call double @cartDouble(%struct.cart* %7, i32 %10)
ret double %11
}

LLVM IR (-O2):
%struct.cart = type { i32 }
define double @cartDoubleDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_cartVarDbName(i8* %1, i8* %2)
%5 = tail call double @cartDouble(%struct.cart* %0, i32 %4)
ret double %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mqtt_get_qos(uint8_t *buffer) { return (buffer[0] & 0x06) >> 1; }


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

x86 assembly (clang, -O2):
<mqtt_get_qos>:
mov    (%rdi),%eax
shr    %eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mqtt_get_qos(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 6
%7 = ashr i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @mqtt_get_qos(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 1
%4 = and i32 %3, 3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void abstract() {
  if (0)
    fprintf(stderr, "void abstract()\n");
  check(2);
}


x86 assembly (clang, -O0):
<abstract>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <check@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<abstract>:
mov    $0x2,%edi
jmp    1030 <check@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @abstract() {
%1 = call i32 @check(i32 2)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @abstract() {
%1 = tail call i32 @check(i32 2)
ret void
}
/* Variables and functions */
char *strchr(char *, char const);
void stress_chop(char *str, const char ch) {
  char *ptr = strchr(str, ch);
  if (ptr)
    *ptr = '\0';
}


x86 assembly (clang, -O0):
<stress_chop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <stress_chop+0x35>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_chop>:
push   %rax
call   1030 <strchr@plt>
test   %rax,%rax
je     111e <stress_chop+0xe>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @stress_chop(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
const char *eiki_sigsegv_info(int code) {
  switch (code) {
  default:
    return NULL;
  }
}


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

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

LLVM IR (-O0):
define i8* @eiki_sigsegv_info(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @eiki_sigsegv_info(i32 %0) {
ret i8* null
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
int scan_string(char *str) {
  int i;
  i = read(0, str, 1024);
  return i;
}


x86 assembly (clang, -O0):
<scan_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1030 <read@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_string>:
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x400,%edx
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @scan_string(i8* nocapture %0) {
%2 = tail call i32 @read(i32 0, i8* %0, i32 1024)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  for (i = 0; i < 10; i++) {
    const int a = i;
  }
  int array[10];
  for (i = 0; i < 10; i++) {
    const int a;
    array[i] = a;
  }
  assert(array[0] == array[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1144 <main+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116e <main+0x5e>
mov    -0x44(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <main+0x3b>
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %11, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
store i32 %10, i32* %3
br label %11
11: ; preds = %9
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %6
14: ; preds = %6
store i32 0, i32* %2
br label %15
15: ; preds = %23, %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* %5
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %21
store i32 %19, i32* %22
br label %23
23: ; preds = %18
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %15
26: ; preds = %15
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%28 = load i32, i32* %27
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 1
%30 = load i32, i32* %29
%31 = icmp eq i32 %28, %30
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
short big2littles(short);
scalar_t__ isLittleEndian();
short big2hosts(short num) {
  if (isLittleEndian())
    return big2littles(num);
  return num;
}


x86 assembly (clang, -O0):
<big2hosts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <isLittleEndian@plt>
cmp    $0x0,%rax
je     1152 <big2hosts+0x32>
movswl -0x4(%rbp),%edi
call   1030 <big2littles@plt>
mov    %ax,-0x2(%rbp)
jmp    115a <big2hosts+0x3a>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big2hosts>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <isLittleEndian@plt>
test   %rax,%rax
je     1138 <big2hosts+0x18>
movswl %bx,%edi
pop    %rbx
jmp    1030 <big2littles@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @big2hosts(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i64 (...) @isLittleEndian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i16, i16* %3
%8 = call signext i16 @big2littles(i16 signext %7)
store i16 %8, i16* %2
br label %11
9: ; preds = %1
%10 = load i16, i16* %3
store i16 %10, i16* %2
br label %11
11: ; preds = %9, %6
%12 = load i16, i16* %2
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @big2hosts(i16 signext %0) {
%2 = tail call i64 (...) @isLittleEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call signext i16 @big2littles(i16 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i16 [ %5, %4 ], [ %0, %1 ]
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *init_http_session();
int /*<<< orphan*/ set_hls_http_header(void *);
void *init_hls_session(void) {
  void *session = init_http_session();
  assert(session);
  set_hls_http_header(session);
  return session;
}


x86 assembly (clang, -O0):
<init_hls_session>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <init_http_session@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <set_hls_http_header@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_hls_session>:
push   %rbx
xor    %eax,%eax
call   1050 <init_http_session@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <set_hls_http_header@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @init_hls_session() {
%1 = alloca i8*
%2 = call i8* (...) @init_http_session()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @set_hls_http_header(i8* %5)
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
define i8* @init_hls_session() {
%1 = tail call i8* (...) @init_http_session()
%2 = tail call i32 @assert(i8* %1)
%3 = tail call i32 @set_hls_http_header(i8* %1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void debug_dump_arg(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; ++i) {
    printf("[%d] [%s]\n", i, argv[i]);
  }
}


x86 assembly (clang, -O0):
<debug_dump_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <debug_dump_arg+0x4b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <debug_dump_arg+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"[%d] [%s]\0A\00"
define void @debug_dump_arg(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ WEXITSTATUS(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int whatis_is_installed() {
  int res;
  res = (WEXITSTATUS(system("command -v whatis >> /dev/null")) == 0) ? 1 : 0;
  return res;
}


x86 assembly (clang, -O0):
<whatis_is_installed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <WEXITSTATUS@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whatis_is_installed>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <WEXITSTATUS@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"command -v whatis >> /dev/null\00"
define i32 @whatis_is_installed() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @WEXITSTATUS(i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [31 x i8] c"command -v whatis >> /dev/null\00"
define i32 @whatis_is_installed() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @WEXITSTATUS(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}