xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long concatenate(int, int);
void concatenate_test(void) {
  assert(concatenate(12345, 678910) == 12345678910L);
}


x86 assembly (clang, -O0):
<concatenate_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3039,%edi
mov    $0xa5bfe,%esi
call   1040 <concatenate@plt>
movabs $0x2dfdc1c3e,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenate_test>:
push   %rax
mov    $0x3039,%edi
mov    $0xa5bfe,%esi
call   1040 <concatenate@plt>
movabs $0x2dfdc1c3e,%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @concatenate_test() {
%1 = call i64 @concatenate(i32 12345, i32 678910)
%2 = icmp eq i64 %1, 12345678910
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
define void @concatenate_test() {
%1 = tail call i64 @concatenate(i32 12345, i32 678910)
%2 = icmp eq i64 %1, 12345678910
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
void ScaleARGBRowDown2_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDown2_Any_NEON() {
ret void
}
char *scanstring(p, dir)
char *p;
int dir;
{
  for (p += dir;; p += dir)
    if (*p == '"' && p[-dir] != '\\')
      return p + dir;
}


x86 assembly (clang, -O0):
<scanstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1152 <scanstring+0x52>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
je     1152 <scanstring+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret
jmp    1157 <scanstring+0x57>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <scanstring+0x1c>

x86 assembly (clang, -O2):
<scanstring>:
movslq %esi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdi,%rcx
add    %rax,%rdi
cmpb   $0x22,(%rcx,%rax,1)
jne    1110 <scanstring+0x10>
cmpb   $0x5c,(%rcx)
je     1110 <scanstring+0x10>
lea    (%rcx,%rax,2),%rax
ret

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

LLVM IR (-O2):
define i8* @scanstring(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i32 0, %1
%5 = sext i32 %4 to i64
br label %6
6: ; preds = %11, %2
%7 = phi i8* [ %0, %2 ], [ %8, %11 ]
%8 = getelementptr inbounds i8, i8* %7, i64 %3
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 34
br i1 %10, label %12, label %11
11: ; preds = %6, %12
br label %6
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 %5
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 92
br i1 %15, label %11, label %16
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %8, i64 %3
ret i8* %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *gost_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_gost(unsigned char *out, FILE *fp) {
  return gost_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_gost>:
jmp    1030 <gost_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_gost(i8* %0, i32* %1) {
%3 = tail call i8* @gost_file(i8* %0, i32* %1)
ret i8* %3
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ unlink(char *);
void sck_cleanup(void) {
  char sck_path[256];
  sprintf(sck_path,
          ("/tmp/"
           "%d.sock"),
          (int)getpid());
  unlink(sck_path);
}


x86 assembly (clang, -O0):
<sck_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x108(%rbp),%rdi
mov    %eax,%edx
lea    0xea0(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sck_cleanup>:
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeba(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/tmp/%d.sock\00"
define void @sck_cleanup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 @unlink(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/tmp/%d.sock\00"
define void @sck_cleanup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @unlink(i8* %2)
ret void
}
void a_crash() { __asm__ __volatile__("hlt" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @a_crash() {
tail call void asm sideeffect "hlt", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double acosh(double x) { return log(x + sqrt(x * x - 1.0)); }


x86 assembly (clang, -O0):
<acosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosh>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xece(%rip),%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @acosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -1.000000e+00)
%7 = call i64 @sqrt(double %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %3, %8
%10 = fptosi double %9 to i64
%11 = call double @log(i64 %10)
ret double %11
}

LLVM IR (-O2):
define double @acosh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -1.000000e+00)
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, %0
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
ret double %7
}
void RTTcpSetSendCoalescing(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpSetSendCoalescing() {
ret void
}
/* Variables and functions */
double f(int, float);
int /*<<< orphan*/ printf(char *, double);
main() { printf("%.0f\n", f(2, (float)3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
movss  0xecf(%rip),%xmm0
call   1030 <f@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
mov    $0x2,%edi
call   1030 <f@plt>
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = call double @f(i32 2, float 3.000000e+00)
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = tail call double @f(i32 2, float 3.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
void compute_namelen(struct dirent *dent __attribute__((unused))) {
  (void)dent;
  return;
}


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

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

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

LLVM IR (-O2):
%struct.dirent = type opaque
define void @compute_namelen(%struct.dirent* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ fopen(char const *, char const *);
void *c_fopen(const char *path, const char *mode) {
  return (void *)fopen(path, mode);
}


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

x86 assembly (clang, -O2):
<c_fopen>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i8* @c_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @fopen(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @c_fopen(i8* %0, i8* %1) {
%3 = tail call i64 @fopen(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int my_function() { return 2; }


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

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

LLVM IR (-O0):
define i32 @my_function() {
ret i32 2
}

LLVM IR (-O2):
define i32 @my_function() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int CED_WaitEvent(int fh, int nArea, int msTimeOut) {
  return ioctl(fh, _IO(0xce, 45), (nArea & 0xff) | (msTimeOut << 8));
}


x86 assembly (clang, -O0):
<CED_WaitEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xce,%edi
mov    $0x2d,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     %eax,%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_WaitEvent>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xce,%edi
mov    $0x2d,%esi
call   1030 <_IO@plt>
movzbl %bpl,%ecx
shl    $0x8,%ebx
or     %ecx,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_WaitEvent(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 = call i32 @_IO(i32 206, i32 45)
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
%14 = call i32 @ioctl(i32 %7, i32 %8, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @CED_WaitEvent(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 206, i32 45)
%5 = and i32 %1, 255
%6 = shl i32 %2, 8
%7 = or i32 %6, %5
%8 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %7)
ret i32 %8
}
int Test6() {
  int B[200];
  return B[4];
}


x86 assembly (clang, -O0):
<Test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
mov    -0x310(%rbp),%eax
add    $0x2a0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Test6() {
%1 = alloca [200 x i32]
%2 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 4
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @Test6() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ UChar;
typedef int /*<<< orphan*/ UBreakIterator;

/* Variables and functions */
int /*<<< orphan*/ printTextRange(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
int /*<<< orphan*/ ubrk_following(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ ubrk_previous(int /*<<< orphan*/ *);
void printAt(UBreakIterator *boundary, int32_t pos, UChar *str) {
  int32_t start;
  int32_t end = ubrk_following(boundary, pos);
  start = ubrk_previous(boundary);
  printTextRange(str, start, end);
}


x86 assembly (clang, -O0):
<printAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <ubrk_following@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ubrk_previous@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1050 <printTextRange@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAt>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
call   1040 <ubrk_following@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <ubrk_previous@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <printTextRange@plt>

LLVM IR (-O0):
define void @printAt(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32 @ubrk_following(i32* %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32*, i32** %4
%13 = call i32 @ubrk_previous(i32* %12)
store i32 %13, i32* %7
%14 = load i32*, i32** %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i32 @printTextRange(i32* %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @printAt(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @ubrk_following(i32* %0, i32 %1)
%5 = tail call i32 @ubrk_previous(i32* %0)
%6 = tail call i32 @printTextRange(i32* %2, i32 %5, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvUseLibrary(char byBoardNum, char *szLibName) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvUseLibrary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvUseLibrary>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvUseLibrary(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvUseLibrary(i8 signext %0, i8* nocapture readnone %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int obterDivisor(int n) {
  if (n < 10) {
    return 10;
  } else {
    return 10 * obterDivisor(n / 10);
  }
}


x86 assembly (clang, -O0):
<obterDivisor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1131 <obterDivisor+0x21>
movl   $0xa,-0x4(%rbp)
jmp    1149 <obterDivisor+0x39>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <obterDivisor@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obterDivisor>:
mov    $0xa,%eax
cmp    $0xa,%edi
jl     113c <obterDivisor+0x3c>
mov    $0x1,%edx
mov    $0xcccccccd,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
mov    %edi,%esi
imul   %rax,%rsi
shr    $0x23,%rsi
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
cmp    $0x63,%edi
mov    %esi,%edi
ja     1120 <obterDivisor+0x20>
imul   $0x64,%ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @obterDivisor(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 1, %1 ]
%6 = udiv i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = icmp ult i32 %4, 100
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = mul i32 %5, 100
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 10, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int tv_diff(struct timeval t1, struct timeval t2) {
  return (((t1.tv_sec - t2.tv_sec) * 1000000) + (t1.tv_usec - t2.tv_usec)) /
         1000;
}


x86 assembly (clang, -O0):
<tv_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv_diff>:
mov    %rdi,%rax
shr    $0x20,%rax
sub    %esi,%edi
shr    $0x20,%rsi
imul   $0xf4240,%edi,%ecx
sub    %esi,%eax
add    %ecx,%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @tv_diff(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %5
%6 = bitcast %struct.timeval* %4 to i64*
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = mul nsw i32 %11, 1000000
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = add nsw i32 %12, %17
%19 = sdiv i32 %18, 1000
ret i32 %19
}

LLVM IR (-O2):
define i32 @tv_diff(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = trunc i64 %1 to i32
%7 = lshr i64 %1, 32
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %3, %6
%10 = mul nsw i32 %9, 1000000
%11 = sub i32 %5, %8
%12 = add nsw i32 %11, %10
%13 = sdiv i32 %12, 1000
ret i32 %13
}
long _ackermann(long EV_m, long EV_n) {
  if ((EV_m == 0)) {
    return (EV_n + 1);
  }
  if ((EV_n == 0)) {
    return _ackermann((EV_m - 1), 1);
  } else {
    return _ackermann((EV_m - 1), _ackermann(EV_m, (EV_n - 1)));
  }
}


x86 assembly (clang, -O0):
<_ackermann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113c <_ackermann+0x2c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    118f <_ackermann+0x7f>
cmpq   $0x0,-0x18(%rbp)
jne    1162 <_ackermann+0x52>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
mov    $0x1,%esi
call   1030 <_ackermann@plt>
mov    %rax,-0x8(%rbp)
jmp    118f <_ackermann+0x7f>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
call   1030 <_ackermann@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1030 <_ackermann@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ackermann>:
push   %rbx
mov    %rsi,%rax
test   %rdi,%rdi
je     1145 <_ackermann+0x35>
mov    %rdi,%rbx
jmp    112b <_ackermann+0x1b>
xchg   %ax,%ax
mov    $0x1,%eax
add    $0xffffffffffffffff,%rbx
je     1145 <_ackermann+0x35>
test   %rax,%rax
je     1120 <_ackermann+0x10>
add    $0xffffffffffffffff,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <_ackermann@plt>
add    $0xffffffffffffffff,%rbx
jne    112b <_ackermann+0x1b>
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @_ackermann(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i64 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i64 %5, 1
ret i64 %6
7: ; preds = %2, %11
%8 = phi i64 [ %12, %11 ], [ %1, %2 ]
%9 = phi i64 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i64 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i64 %9, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i64 %8, -1
%17 = tail call i64 @_ackermann(i64 %9, i64 %16)
br label %11
}
void foo3(int j, int n, int *a) {
  int i;
#pragma omp target teams
#pragma omp distribute parallel for shared(a) firstprivate(n) private(i)       \
    firstprivate(j)
  for (i = j + 1; i < n; i += 3)
    a[i] = i;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113f <foo3+0x3f>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <foo3+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
add    $0x1,%edi
cmp    %esi,%edi
jge    111c <foo3+0x1c>
movslq %edi,%rax
movslq %esi,%rcx
nopl   (%rax)
mov    %eax,(%rdx,%rax,4)
add    $0x3,%rax
cmp    %rcx,%rax
jl     1110 <foo3+0x10>
ret

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

LLVM IR (-O2):
define void @foo3(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add i32 %0, 1
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ %7, %6 ], [ %13, %9 ]
%11 = getelementptr inbounds i32, i32* %2, i64 %10
%12 = trunc i64 %10 to i32
store i32 %12, i32* %11
%13 = add nsw i64 %10, 3
%14 = icmp slt i64 %13, %8
br i1 %14, label %9, label %15
15: ; preds = %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __do_binderfs_test();
int /*<<< orphan*/ change_to_userns();
void binderfs_test_unprivileged() {
  change_to_userns();
  __do_binderfs_test();
}


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

x86 assembly (clang, -O2):
<binderfs_test_unprivileged>:
push   %rax
xor    %eax,%eax
call   1030 <change_to_userns@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__do_binderfs_test@plt>

LLVM IR (-O0):
define void @binderfs_test_unprivileged() {
%1 = call i32 (...) @change_to_userns()
%2 = call i32 (...) @__do_binderfs_test()
ret void
}

LLVM IR (-O2):
define void @binderfs_test_unprivileged() {
%1 = tail call i32 (...) @change_to_userns()
%2 = tail call i32 (...) @__do_binderfs_test()
ret void
}
void free_2d_int(int **ii) {
  free(ii[0]);
  free(ii);
}


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

x86 assembly (clang, -O2):
<free_2d_int>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d_int(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 = bitcast i32* %5 to i8*
%7 = load i32**, i32*** %2
%8 = bitcast i32** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2d_int(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i32** %0 to i8*
tail call void @free(i8* %4)
ret void
}
long nsec2usec(long nsec) { return nsec / 1000L; }


x86 assembly (clang, -O0):
<nsec2usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsec2usec>:
mov    %rdi,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @nsec2usec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, 1000
ret i64 %4
}

LLVM IR (-O2):
define i64 @nsec2usec(i64 %0) {
%2 = sdiv i64 %0, 1000
ret i64 %2
}
void WritePortA(struct z26_state *s) {}


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

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

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

LLVM IR (-O2):
%struct.z26_state = type opaque
define void @WritePortA(%struct.z26_state* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
int /*<<< orphan*/ sprintf(char *, char *);
void get_else() {
  char line[140];
  sprintf(line, "command Else");
  emit(line);
}


x86 assembly (clang, -O0):
<get_else>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <emit@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_else>:
sub    $0x98,%rsp
movabs $0x65736c4520646e,%rax
mov    %rax,0x5(%rsp)
movabs $0x20646e616d6d6f63,%rax
6e 64 20
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <emit@plt>
add    $0x98,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"command Else\00"
define void @get_else() {
%1 = alloca [140 x i8]
%2 = getelementptr inbounds [140 x i8], [140 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [140 x i8], [140 x i8]* %1, i64 0, i64 0
%5 = call i32 @emit(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"command Else\00"
define void @get_else() {
%1 = alloca [140 x i8]
%2 = getelementptr inbounds [140 x i8], [140 x i8]* %1, i64 0, i64 0
%3 = call i32 @emit(i8* %2)
ret void
}
void gtk_widget_get_child_requisition() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_child_requisition() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(void *);
scalar_t__ OPENSSL_malloc(int);
void *CRYPTO_remalloc(void *a, int num, const char *file, int line) {
  if (a != NULL)
    OPENSSL_free(a);
  a = (char *)OPENSSL_malloc(num);
  return (a);
}


x86 assembly (clang, -O0):
<CRYPTO_remalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <CRYPTO_remalloc+0x2a>
mov    -0x8(%rbp),%rdi
call   1040 <OPENSSL_free@plt>
mov    -0xc(%rbp),%edi
call   1030 <OPENSSL_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_remalloc>:
push   %rbx
mov    %esi,%ebx
test   %rdi,%rdi
je     112d <CRYPTO_remalloc+0xd>
call   1040 <OPENSSL_free@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <OPENSSL_malloc@plt>

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

LLVM IR (-O2):
define i8* @CRYPTO_remalloc(i8* %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @OPENSSL_free(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i64 @OPENSSL_malloc(i32 %1)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Type definitions */
struct s_console {
  int dummy;
};

/* Variables and functions */
int consoleOut(struct s_console *, char *, int);
int consoleNL(struct s_console *console) {
  return consoleOut(console, "\r\n", 2);
}


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

x86 assembly (clang, -O2):
<consoleNL>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <consoleOut@plt>

LLVM IR (-O0):
%struct.s_console = type { i32 }
@.str = [3 x i8] c"\0D\0A\00"
define i32 @consoleNL(%struct.s_console* %0) {
%2 = alloca %struct.s_console*
store %struct.s_console* %0, %struct.s_console** %2
%3 = load %struct.s_console*, %struct.s_console** %2
%4 = call i32 @consoleOut(%struct.s_console* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 %4
}

LLVM IR (-O2):
%struct.s_console = type { i32 }
@.str = [3 x i8] c"\0D\0A\00"
define i32 @consoleNL(%struct.s_console* %0) {
%2 = tail call i32 @consoleOut(%struct.s_console* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 %2
}
int test_imm_FAint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xFA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FAint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1073741824000
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef unsigned short screen_id;
typedef unsigned short control_id;

/* Variables and functions */
int /*<<< orphan*/ SendChar(unsigned short);
void FlashSaveControl(unsigned short int screen_id,
                      unsigned short int control_id) {
  SendChar(((screen_id) >> 8) & 0xFF);
  SendChar((screen_id)&0xFF);
  SendChar(((control_id) >> 8) & 0xFF);
  SendChar((control_id)&0xFF);
}


x86 assembly (clang, -O0):
<FlashSaveControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1030 <SendChar@plt>
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1030 <SendChar@plt>
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashSaveControl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bpl,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @FlashSaveControl(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i16
%10 = call i32 @SendChar(i16 zeroext %9)
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i16
%15 = call i32 @SendChar(i16 zeroext %14)
%16 = load i16, i16* %4
%17 = zext i16 %16 to i32
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i16
%21 = call i32 @SendChar(i16 zeroext %20)
%22 = load i16, i16* %4
%23 = zext i16 %22 to i32
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i16
%26 = call i32 @SendChar(i16 zeroext %25)
ret void
}

LLVM IR (-O2):
define void @FlashSaveControl(i16 zeroext %0, i16 zeroext %1) {
%3 = lshr i16 %0, 8
%4 = tail call i32 @SendChar(i16 zeroext %3)
%5 = and i16 %0, 255
%6 = tail call i32 @SendChar(i16 zeroext %5)
%7 = lshr i16 %1, 8
%8 = tail call i32 @SendChar(i16 zeroext %7)
%9 = and i16 %1, 255
%10 = tail call i32 @SendChar(i16 zeroext %9)
ret void
}
void swap(int *i, int *j) {
  int t = *i;
  *i = *j;
  *j = t;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
size_t ZSTD_minGain(size_t srcSize) { return (srcSize >> 6) + 1; }


x86 assembly (clang, -O0):
<ZSTD_minGain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x6,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZSTD_minGain>:
shr    $0x6,%rdi
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @ZSTD_minGain(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 6
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @ZSTD_minGain(i64 %0) {
%2 = lshr i64 %0, 6
%3 = add nuw nsw i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void f() { bar(); }


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

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

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

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 (...) @bar()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void closedirp(DIR **p) {
  if (*p)
    closedir(*p);
}


x86 assembly (clang, -O0):
<closedirp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <closedirp+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closedirp>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <closedirp+0xd>
jmp    1030 <closedir@plt>
ret

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

LLVM IR (-O2):
define void @closedirp(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_epu16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi16(int);
int /*<<< orphan*/ _mm_srli_epi16(int /*<<< orphan*/, int);
__m128i _mm_div255_epu16(__m128i x) {
  return _mm_srli_epi16(_mm_adds_epu16(_mm_adds_epu16(x, _mm_set1_epi16(1)),
                                       _mm_srli_epi16(x, 8)),
                        8);
}


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

x86 assembly (clang, -O2):
<_mm_div255_epu16>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%edi
call   1050 <_mm_set1_epi16@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <_mm_adds_epu16@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <_mm_srli_epi16@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <_mm_adds_epu16@plt>
mov    %eax,%edi
mov    $0x8,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_mm_srli_epi16@plt>

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

LLVM IR (-O2):
define i32 @_mm_div255_epu16(i32 %0) {
%2 = tail call i32 @_mm_set1_epi16(i32 1)
%3 = tail call i32 @_mm_adds_epu16(i32 %0, i32 %2)
%4 = tail call i32 @_mm_srli_epi16(i32 %0, i32 8)
%5 = tail call i32 @_mm_adds_epu16(i32 %3, i32 %4)
%6 = tail call i32 @_mm_srli_epi16(i32 %5, i32 8)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void asc_simple_logging_err(const char *format, va_list args) {
  vfprintf(stderr, format, args);
  fprintf(stderr, "\n");
}


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

x86 assembly (clang, -O2):
<asc_simple_logging_err>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edi
call   1040 <vfprintf@plt>
mov    (%rbx),%edi
lea    0xec3(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @asc_simple_logging_err(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: judge-shuff [<options>] <output> "
          "<correct>\n\nOptions:\n-n\t\tIgnore newlines and match the whole "
          "input as a single line\n-e\t\tIgnore empty lines\n-l\t\tShuffle "
          "lines (i.e., ignore their order)\n-w\t\tShuffle words in each "
          "line\n-i\t\tIgnore case\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [239 x i8] c"Usage: judge-shuff [<options>] <output> <correct>\0A\0AOptions:\0A-n\09\09Ignore newlines and match the whole input as a single line\0A-e\09\09Ignore empty lines\0A-l\09\09Shuffle lines (i.e., ignore their order)\0A-w\09\09Shuffle words in each line\0A-i\09\09Ignore case\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([239 x i8], [239 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [239 x i8] c"Usage: judge-shuff [<options>] <output> <correct>\0A\0AOptions:\0A-n\09\09Ignore newlines and match the whole input as a single line\0A-e\09\09Ignore empty lines\0A-l\09\09Shuffle lines (i.e., ignore their order)\0A-w\09\09Shuffle words in each line\0A-i\09\09Ignore case\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([239 x i8], [239 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}