xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *s) {
  char *t;
  int len;
  if (!s)
    return NULL;
  len = strlen(s);
  t = (char *)malloc(len + 1);
  memcpy(t, s, len + 1);
  return t;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118a <strdup+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     115d <strdup+0x2d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1160 <strdup+0x30>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* null, i8** %2
br label %22
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %4
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
%20 = call i32 @memcpy(i8* %16, i8* %17, i32 %19)
%21 = load i8*, i8** %4
store i8* %21, i8** %2
br label %22
22: ; preds = %9, %8
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %5)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
double c_dot(double *v1, double *v2) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<c_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @c_dot(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @c_dot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Type definitions */
struct msghdr {
  int dummy;
};
struct __uportsys_msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ __uportsys_recvmsg(int, struct __uportsys_msghdr *, int,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
ssize_t recvmsg(int sd, struct msghdr *msg, int flags) {
  return __uportsys_recvmsg(sd, (struct __uportsys_msghdr *)msg, flags, &errno);
}


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

x86 assembly (clang, -O2):
<recvmsg>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <__uportsys_recvmsg@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32 }
%struct.__uportsys_msghdr = type { i32 }
@errno = global i32 0
define i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.msghdr*, %struct.msghdr** %5
%9 = bitcast %struct.msghdr* %8 to %struct.__uportsys_msghdr*
%10 = load i32, i32* %6
%11 = call i32 @__uportsys_recvmsg(i32 %7, %struct.__uportsys_msghdr* %9, i32 %10, i32* @errno)
ret i32 %11
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
%struct.__uportsys_msghdr = type { i32 }
@errno = global i32 0
define i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = bitcast %struct.msghdr* %1 to %struct.__uportsys_msghdr*
%5 = tail call i32 @__uportsys_recvmsg(i32 %0, %struct.__uportsys_msghdr* %4, i32 %2, i32* @errno)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char *names[] = {"Martin", "Alejandro", "Noblia"};
  printf("%c\n", names[2][0]);
  printf("%c\n", *(*(names + 1) + 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cd4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xecd(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xeba(%rip),%rdi
movsbl 0x2(%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4e,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Martin\00"
@.str.1 = [10 x i8] c"Alejandro\00"
@.str.2 = [7 x i8] c"Noblia\00"
@__const.main.names = [3 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8*]
store i32 0, i32* %1
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 2
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext %7)
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext %13)
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext 78)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext 101)
ret i32 0
}
void gtk_font_button_set_use_font() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_button_set_use_font() {
ret void
}
/* Variables and functions */
long double __qlog10(long double);
long double __q_lg10(long double *arg) { return (__qlog10(*arg)); }


x86 assembly (clang, -O0):
<__q_lg10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qlog10@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_lg10>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qlog10@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__q_lg10(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = load x86_fp80*, x86_fp80** %2
%4 = load x86_fp80, x86_fp80* %3
%5 = call x86_fp80 @__qlog10(x86_fp80 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @__q_lg10(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qlog10(x86_fp80 %2)
ret x86_fp80 %3
}
int fand(int a, int b) {
  int tmp;
  a = __builtin_bswap32(a);
  b = __builtin_bswap32(b);
  tmp = a & b;
  return __builtin_bswap32(tmp);
}


x86 assembly (clang, -O0):
<fand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
bswap  %eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
bswap  %eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
bswap  %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fand>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @llvm.bswap.i32(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @llvm.bswap.i32(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = call i32 @llvm.bswap.i32(i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @fand(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
int magic(int value) { return value + 42; }


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

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

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

LLVM IR (-O2):
define i32 @magic(i32 %0) {
%2 = add nsw i32 %0, 42
ret i32 %2
}
void ASN1_item_digest(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_digest() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mxml_release_string(char const *);
void cfg_mvp_release_string(const char *str) { mxml_release_string(str); }


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

x86 assembly (clang, -O2):
<cfg_mvp_release_string>:
jmp    1030 <mxml_release_string@plt>

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

LLVM IR (-O2):
define void @cfg_mvp_release_string(i8* %0) {
%2 = tail call i32 @mxml_release_string(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

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


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

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

LLVM IR (-O0):
define i32 @timestamp() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @timestamp() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
void midi_init() {}


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

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

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

LLVM IR (-O2):
define void @midi_init() {
ret void
}
__attribute__((target("default"))) void foo_decls(void) {}


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

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

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

LLVM IR (-O2):
define void @foo_decls() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double frac(double u, double v) {
  if (0. == v) {
    assert(0. == u);
    return 0.;
  }
  return u / v;
}


x86 assembly (clang, -O0):
<frac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    115d <frac+0x4d>
jp     115d <frac+0x4d>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116c <frac+0x5c>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frac>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1138 <frac+0x28>
jp     1138 <frac+0x28>
push   %rax
cmpeqsd %xmm2,%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <assert@plt>
xorpd  %xmm0,%xmm0
add    $0x8,%rsp
ret
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @frac(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp oeq double 0.000000e+00, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %4
%10 = fcmp oeq double 0.000000e+00, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
store double 0.000000e+00, double* %3
br label %17
13: ; preds = %2
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fdiv double %14, %15
store double %16, double* %3
br label %17
17: ; preds = %13, %8
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @frac(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = fcmp oeq double %0, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br label %10
8: ; preds = %2
%9 = fdiv double %0, %1
br label %10
10: ; preds = %8, %4
%11 = phi double [ 0.000000e+00, %4 ], [ %9, %8 ]
ret double %11
}
/* Type definitions */
struct pt_decoder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pt_decoder *);
void pt_free_decoder(struct pt_decoder *decoder) { free(decoder); }


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

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

LLVM IR (-O2):
%struct.pt_decoder = type { i32 }
define void @pt_free_decoder(%struct.pt_decoder* nocapture %0) {
%2 = tail call i32 @free(%struct.pt_decoder* %0)
ret void
}
int main(int argc, char **argv) {
  char c = (char)argc;
  if (c)
    return c + 1;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x11(%rbp)
cmpb   $0x0,-0x11(%rbp)
je     1131 <main+0x31>
movsbl -0x11(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <main+0x38>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movsbl %dil,%ecx
lea    0x1(%rcx),%edx
xor    %eax,%eax
test   %cl,%cl
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = trunc i32 %0 to i8
%4 = icmp eq i8 %3, 0
%5 = shl i32 %0, 24
%6 = ashr exact i32 %5, 24
%7 = add nsw i32 %6, 1
%8 = select i1 %4, i32 0, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t as86_segbase(int32_t segment) { return segment; }


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

x86 assembly (clang, -O2):
<as86_segbase>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @as86_segbase(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
void TestB() {
  int i = 0x1000;
  while (1) {
    milli_delay(10);
  }
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1000,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    111f <TestB+0xf>

x86 assembly (clang, -O2):
<TestB>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    1120 <TestB+0x10>

LLVM IR (-O0):
define void @TestB() {
%1 = alloca i32
store i32 4096, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @milli_delay(i32 10)
br label %2
}

LLVM IR (-O2):
define void @TestB() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @milli_delay(i32 10)
br label %1
}
unsigned char compute_y(int r, int g, int b) {
  return (unsigned char)(((r * 77) + (g * 150) + (29 * b)) >> 8);
}


x86 assembly (clang, -O0):
<compute_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x4d,-0x4(%rbp),%eax
imul   $0x96,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x1d,-0xc(%rbp),%ecx
add    %ecx,%eax
sar    $0x8,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_y>:
imul   $0x4d,%edi,%eax
imul   $0x96,%esi,%ecx
add    %eax,%ecx
lea    (%rdx,%rdx,8),%eax
lea    (%rax,%rax,2),%eax
add    %edx,%eax
add    %edx,%eax
add    %ecx,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define zeroext i8 @compute_y(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 = mul nsw i32 %7, 77
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 150
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 29, %12
%14 = add nsw i32 %11, %13
%15 = ashr i32 %14, 8
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @compute_y(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 77
%5 = mul nsw i32 %1, 150
%6 = add nsw i32 %5, %4
%7 = mul nsw i32 %2, 29
%8 = add nsw i32 %6, %7
%9 = lshr i32 %8, 8
%10 = trunc i32 %9 to i8
ret i8 %10
}
unsigned long asm_rol(unsigned long x, unsigned long r) {
  asm("rolq   %%cl, %0" : "=r"(x) : "0"(x), "c"(r));
  return x;
}


x86 assembly (clang, -O0):
<asm_rol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
rol    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asm_rol>:
mov    %rsi,%rcx
mov    %rdi,%rax
rol    %cl,%rax
ret

LLVM IR (-O0):
define i64 @asm_rol(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 i64 asm "rolq %cl, $0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %5, i64 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @asm_rol(i64 %0, i64 %1) {
%3 = tail call i64 asm "rolq %cl, $0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Type definitions */
struct snt_cmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct snt_cmd *);
struct snt_cmd *snt_cr_cmd(int, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ snt_print_cmd(struct snt_cmd *);
int main() {
  struct snt_cmd *cmd = snt_cr_cmd(7734, 2, 0, NULL);
  snt_print_cmd(cmd);
  free(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1e36,%edi
mov    $0x2,%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <snt_cr_cmd@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <snt_print_cmd@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1e36,%edi
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <snt_cr_cmd@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <snt_print_cmd@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.snt_cmd = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.snt_cmd*
store i32 0, i32* %1
%3 = call %struct.snt_cmd* @snt_cr_cmd(i32 7734, i32 2, i32 0, i32* null)
store %struct.snt_cmd* %3, %struct.snt_cmd** %2
%4 = load %struct.snt_cmd*, %struct.snt_cmd** %2
%5 = call i32 @snt_print_cmd(%struct.snt_cmd* %4)
%6 = load %struct.snt_cmd*, %struct.snt_cmd** %2
%7 = call i32 @free(%struct.snt_cmd* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.snt_cmd = type { i32 }
define i32 @main() {
%1 = tail call %struct.snt_cmd* @snt_cr_cmd(i32 7734, i32 2, i32 0, i32* null)
%2 = tail call i32 @snt_print_cmd(%struct.snt_cmd* %1)
%3 = tail call i32 @free(%struct.snt_cmd* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void init_bar(int *i, int *j) {
  *i = 0;
  *j = 0;
  printf("[");
}


x86 assembly (clang, -O0):
<init_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_bar>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
mov    $0x5b,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @init_bar(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 0, i32* %0
store i32 0, i32* %1
%3 = tail call i32 @putchar(i32 91)
ret void
}
char *strcpy(char *dest, const char *src) {
  unsigned int i;
  for (i = 0; src[i]; i++)
    dest[i] = src[i];
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1146 <strcpy+0x46>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
add    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
jne    1110 <strcpy+0x10>
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %11, %5 ], [ 0, %2 ]
%8 = phi i32 [ %10, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %9
%10 = add i32 %8, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %10 to i64
br label %17
17: ; preds = %2, %15
%18 = phi i64 [ %16, %15 ], [ 0, %2 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret i8* %0
}
void construAvlT4SmMt2(void *bin, char isWD, const char *key, int sizeDt,
                       int sizeKy, void *fnt) {}


x86 assembly (clang, -O0):
<construAvlT4SmMt2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @construAvlT4SmMt2(i8* %0, i8 signext %1, i8* %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i8* %0, i8** %7
store i8 %1, i8* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
ret void
}

LLVM IR (-O2):
define void @construAvlT4SmMt2(i8* nocapture %0, i8 signext %1, i8* nocapture %2, i32 %3, i32 %4, i8* nocapture %5) {
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int fuzix_islower(int c) { return ((uint8_t)c >= 'a') && ((uint8_t)c <= 'z'); }


x86 assembly (clang, -O0):
<fuzix_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x5(%rbp)
jl     112a <fuzix_islower+0x2a>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzix_islower>:
shl    $0x18,%edi
add    $0x9fffffff,%edi
xor    %eax,%eax
cmp    $0x1affffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @fuzix_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @fuzix_islower(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1610612737
%4 = icmp ult i32 %3, 452984831
%5 = zext i1 %4 to i32
ret i32 %5
}
int byte_row_johab_hangul(int byte) {
  if (byte >= 0x84 && byte < 0xd4)
    return byte - 0x84;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_row_johab_hangul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x84,-0x8(%rbp)
jl     1131 <byte_row_johab_hangul+0x31>
cmpl   $0xd4,-0x8(%rbp)
jge    1131 <byte_row_johab_hangul+0x31>
mov    -0x8(%rbp),%eax
sub    $0x84,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <byte_row_johab_hangul+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_row_johab_hangul>:
lea    -0x84(%rdi),%ecx
cmp    $0x50,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_row_johab_hangul(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 132
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 212
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 132
store i32 %11, i32* %2
br label %13
12: ; preds = %6, %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @byte_row_johab_hangul(i32 %0) {
%2 = add i32 %0, -132
%3 = icmp ult i32 %2, 80
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
/* Type definitions */
struct athena_args {
  int dummy;
};
struct arg_parser_params {
  int dummy;
};

/* Variables and functions */
int arg_parser_internal(int, char **, struct athena_args *,
                        struct arg_parser_params *, int /*<<< orphan*/);
int arg_parser_ext(int argc, char **argv, struct athena_args *args_info,
                   struct arg_parser_params *params) {
  int result;
  result = arg_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<arg_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <arg_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <arg_parser_internal@plt>

LLVM IR (-O0):
%struct.athena_args = type { i32 }
%struct.arg_parser_params = type { i32 }
define i32 @arg_parser_ext(i32 %0, i8** %1, %struct.athena_args* %2, %struct.arg_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.athena_args*
%8 = alloca %struct.arg_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.athena_args* %2, %struct.athena_args** %7
store %struct.arg_parser_params* %3, %struct.arg_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.athena_args*, %struct.athena_args** %7
%13 = load %struct.arg_parser_params*, %struct.arg_parser_params** %8
%14 = call i32 @arg_parser_internal(i32 %10, i8** %11, %struct.athena_args* %12, %struct.arg_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.athena_args = type { i32 }
%struct.arg_parser_params = type { i32 }
define i32 @arg_parser_ext(i32 %0, i8** %1, %struct.athena_args* %2, %struct.arg_parser_params* %3) {
%5 = tail call i32 @arg_parser_internal(i32 %0, i8** %1, %struct.athena_args* %2, %struct.arg_parser_params* %3, i32 0)
ret i32 %5
}
float plus(float c, float d) { return c + d; }


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @plus(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @plus(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int bitmap_get(uint64_t *map, unsigned bitno) {
  int pos = bitno / 64;
  int bit = bitno % 64;
  return !!(map[pos] & (1ULL << bit));
}


x86 assembly (clang, -O0):
<bitmap_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_get>:
mov    %esi,%eax
shr    $0x6,%eax
mov    (%rdi,%rax,8),%rcx
xor    %eax,%eax
bt     %rsi,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @bitmap_get(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = udiv i32 %7, 64
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = urem i32 %9, 64
store i32 %10, i32* %6
%11 = load i64*, i64** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %11, i64 %13
%15 = load i64, i64* %14
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = shl i64 1, %17
%19 = and i64 %15, %18
%20 = icmp ne i64 %19, 0
%21 = xor i1 %20, true
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @bitmap_get(i64* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 6
%4 = and i32 %1, 63
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = zext i32 %4 to i64
%9 = shl nuw i64 1, %8
%10 = and i64 %7, %9
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
int fun_int(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @fun_int() {
ret i32 7
}

LLVM IR (-O2):
define i32 @fun_int() {
ret i32 7
}
/* Type definitions */
typedef int /*<<< orphan*/ o;

/* Variables and functions */
unsigned int hash_block(unsigned char const *, int);
unsigned int int_hash(const void *o) {
  return hash_block((const unsigned char *)&o, sizeof(o));
}


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

x86 assembly (clang, -O2):
<int_hash>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <hash_block@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @int_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i8*
%4 = call i32 @hash_block(i8* %3, i32 8)
ret i32 %4
}

LLVM IR (-O2):
define i32 @int_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i8*
%4 = call i32 @hash_block(i8* %3, i32 8)
ret i32 %4
}
int msm_hsusb_vbus_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_hsusb_vbus_shutdown() {
ret i32 0
}
void ff_hevc_put_hevc_bi_qpel_hv8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_hv8_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void groupmember(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


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

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

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

LLVM IR (-O2):
define void @groupmember() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
int main() {
  int data1 = 10;
  int data2 = 20;
  int result;
  __asm__ __volatile__("imull %%edx, %%eax\n\t"
                       : "=a"(result)
                       : "d"(data1), "a"(data2));
  printf("The result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%eax
imul   %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edx
mov    $0x14,%eax
imul   %edx,%eax
lea    0xedb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm sideeffect "imull %edx, %eax\0A\09", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "imull %edx, %eax\0A\09", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int is_pow_of_2(int val) { return (val & (val - 1)) == 0; }


x86 assembly (clang, -O0):
<is_pow_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pow_of_2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_pow_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_pow_of_2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double rand_double(int const);
double rand_sign();
double rand_signdouble(const int range) {
  return rand_double(range) * rand_sign();
}


x86 assembly (clang, -O0):
<rand_signdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rand_double@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand_sign@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_signdouble>:
push   %rax
call   1030 <rand_double@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <rand_sign@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_signdouble(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call double @rand_double(i32 %3)
%5 = call double (...) @rand_sign()
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @rand_signdouble(i32 %0) {
%2 = tail call double @rand_double(i32 %0)
%3 = tail call double (...) @rand_sign()
%4 = fmul double %2, %3
ret double %4
}
unsigned long msm_subsystem_get_domain_no(int subsys_id) { return 0xFFFFFFFF; }


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

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

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

LLVM IR (-O2):
define i64 @msm_subsystem_get_domain_no(i32 %0) {
ret i64 4294967295
}
unsigned xrop3_200_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk1 = S & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_200_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_200_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
void freeaddrinfo_ex(struct addrinfo *ai) { freeaddrinfo(ai); }


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

x86 assembly (clang, -O2):
<freeaddrinfo_ex>:
jmp    1030 <freeaddrinfo@plt>

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

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @freeaddrinfo_ex(%struct.addrinfo* %0) {
%2 = tail call i32 @freeaddrinfo(%struct.addrinfo* %0)
ret void
}
/* Variables and functions */
scalar_t__ kindredSpirits(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", kindredSpirits(NULL, NULL) ? "Success!" : "fail whale :(");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1040 <kindredSpirits@plt>
mov    %rax,%rcx
lea    0xec8(%rip),%rsi
lea    0xeb8(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <kindredSpirits@plt>
test   %rax,%rax
lea    0xed9(%rip),%rax
lea    0xec9(%rip),%rsi
cmove  %rax,%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"Success!\00"
@.str.2 = [14 x i8] c"fail whale :(\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @kindredSpirits(i32* null, i32* null)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"Success!\00"
@.str.2 = [14 x i8] c"fail whale :(\00"
define i32 @main() {
%1 = tail call i64 @kindredSpirits(i32* null, i32* null)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void intel_pt_handle_vmx(int on) {}


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

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

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

LLVM IR (-O2):
define void @intel_pt_handle_vmx(i32 %0) {
ret void
}