xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME_ENTRY;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_ENTRY_it;
X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a,
                                     const unsigned char **in, long len) {
  return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                          &X509_NAME_ENTRY_it);
}


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

x86 assembly (clang, -O2):
<d2i_X509_NAME_ENTRY>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_NAME_ENTRY_it = global i32 0
define i32* @d2i_X509_NAME_ENTRY(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_NAME_ENTRY_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_NAME_ENTRY_it = global i32 0
define i32* @d2i_X509_NAME_ENTRY(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_NAME_ENTRY_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void f_fnptr2(f, fp) int f;
int (*fp)(int);
{ return; }


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

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

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

LLVM IR (-O2):
define void @f_fnptr2(i32 %0, i32 (i32)* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_fun(void *);
void ce_intrn_free_msg_space(void *buf) { free_fun(buf); }


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

x86 assembly (clang, -O2):
<ce_intrn_free_msg_space>:
jmp    1030 <free_fun@plt>

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

LLVM IR (-O2):
define void @ce_intrn_free_msg_space(i8* %0) {
%2 = tail call i32 @free_fun(i8* %0)
ret void
}
/* Type definitions */
struct MinHeap {
  int dummy;
};

/* Variables and functions */
int pop(struct MinHeap *);
int /*<<< orphan*/ push(struct MinHeap *, int);
int replacetop(struct MinHeap *heap, int x) {
  int root = pop(heap);
  push(heap, x);
  return root;
}


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

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

LLVM IR (-O0):
%struct.MinHeap = type { i32 }
define i32 @replacetop(%struct.MinHeap* %0, i32 %1) {
%3 = alloca %struct.MinHeap*
%4 = alloca i32
%5 = alloca i32
store %struct.MinHeap* %0, %struct.MinHeap** %3
store i32 %1, i32* %4
%6 = load %struct.MinHeap*, %struct.MinHeap** %3
%7 = call i32 @pop(%struct.MinHeap* %6)
store i32 %7, i32* %5
%8 = load %struct.MinHeap*, %struct.MinHeap** %3
%9 = load i32, i32* %4
%10 = call i32 @push(%struct.MinHeap* %8, i32 %9)
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
%struct.MinHeap = type { i32 }
define i32 @replacetop(%struct.MinHeap* %0, i32 %1) {
%3 = tail call i32 @pop(%struct.MinHeap* %0)
%4 = tail call i32 @push(%struct.MinHeap* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void sigHandler(int sigNum) { fprintf(stdout, "\nIgnoring interrupt\n"); }


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigHandler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [21 x i8] c"\0AIgnoring interrupt\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [21 x i8] c"\0AIgnoring interrupt\0A\00"
define void @sigHandler(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
long int timedif(struct timeval a, struct timeval b) {
  register int us, s;
  us = a.tv_usec - b.tv_usec;
  us /= 1000;
  s = a.tv_sec - b.tv_sec;
  s *= 1000;
  return s + us;
}


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

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

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

LLVM IR (-O2):
define i64 @timedif(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 = sdiv i32 %9, 1000
%11 = sub nsw i32 %5, %8
%12 = mul nsw i32 %11, 1000
%13 = add nsw i32 %12, %10
%14 = sext i32 %13 to i64
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ utassert(int, char *);
void test_api_one(void) { utassert(1 == 2, "1 equals 2"); }


x86 assembly (clang, -O0):
<test_api_one>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <utassert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_api_one>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <utassert@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"1 equals 2\00"
define void @test_api_one() {
%1 = call i32 @utassert(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"1 equals 2\00"
define void @test_api_one() {
%1 = tail call i32 @utassert(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int simple_int_cmp(const void *a, const void *b) {
  const int *aa = (const int *)a;
  const int *bb = (const int *)b;
  return *aa - *bb;
}


x86 assembly (clang, -O0):
<simple_int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @simple_int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @simple_int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
double convert_time_to_seconds(int minutes, double seconds) {
  double overall_seconds = 0.0;
  overall_seconds = 60.0 * minutes + seconds;
  return overall_seconds;
}


x86 assembly (clang, -O0):
<convert_time_to_seconds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeda(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_time_to_seconds>:
cvtsi2sd %edi,%xmm1
mulsd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @convert_time_to_seconds(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load double, double* %4
%9 = call double @llvm.fmuladd.f64(double 6.000000e+01, double %7, double %8)
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @convert_time_to_seconds(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double @llvm.fmuladd.f64(double %3, double 6.000000e+01, double %1)
ret double %4
}
void EVP_CIPHER_nid(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_nid() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *svn_version();
void print_svn_revision() {
  printf("SVN Revision: "
         "%s\n",
         svn_version());
}


x86 assembly (clang, -O0):
<print_svn_revision>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <svn_version@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_svn_revision>:
push   %rax
xor    %eax,%eax
call   1040 <svn_version@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"SVN Revision: %s\0A\00"
define void @print_svn_revision() {
%1 = call i8* (...) @svn_version()
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"SVN Revision: %s\0A\00"
define void @print_svn_revision() {
%1 = tail call i8* (...) @svn_version()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flockfile(int /*<<< orphan*/);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/);
int putchar_unlocked(int);
int /*<<< orphan*/ stdout;
int putchar(int c) {
  flockfile(stdout);
  int result = putchar_unlocked(c);
  funlockfile(stdout);
  return result;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <flockfile@plt>
mov    -0x4(%rbp),%edi
call   1050 <putchar_unlocked@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <funlockfile@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea3(%rip),%r14
mov    (%r14),%edi
call   1040 <flockfile@plt>
mov    %ebx,%edi
call   1050 <putchar_unlocked@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1030 <funlockfile@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @flockfile(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @putchar_unlocked(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* @stdout
%9 = call i32 @funlockfile(i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @flockfile(i32 %2)
%4 = tail call i32 @putchar_unlocked(i32 %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @funlockfile(i32 %5)
ret i32 %4
}
/* Variables and functions */
unsigned int spread(unsigned short const);
unsigned int zOrder(const unsigned short in_X, const unsigned short in_Y) {
  unsigned int x = spread(in_X);
  unsigned int y = spread(in_Y);
  return x | (y << 1);
}


x86 assembly (clang, -O0):
<zOrder>:
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),%edi
call   1030 <spread@plt>
mov    %eax,-0x8(%rbp)
movzwl -0x4(%rbp),%edi
call   1030 <spread@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zOrder>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <spread@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <spread@plt>
add    %eax,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @zOrder(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
%6 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%7 = load i16, i16* %3
%8 = call i32 @spread(i16 zeroext %7)
store i32 %8, i32* %5
%9 = load i16, i16* %4
%10 = call i32 @spread(i16 zeroext %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = shl i32 %12, 1
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @zOrder(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @spread(i16 zeroext %0)
%4 = tail call i32 @spread(i16 zeroext %1)
%5 = shl i32 %4, 1
%6 = or i32 %5, %3
ret i32 %6
}
void autoscan_deinit(struct wpa_supplicant *wpa_s) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @autoscan_deinit(%struct.wpa_supplicant* nocapture %0) {
ret void
}
int pila_vacia(int sne) {
  if (sne == 100)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<pila_vacia>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jne    111d <pila_vacia+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <pila_vacia+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pila_vacia>:
xor    %eax,%eax
cmp    $0x64,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pila_vacia(i32 %0) {
%2 = icmp eq i32 %0, 100
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("La la la...\nCrash time now.\n");
  ((int *)0)[0] = 1;
  printf("Surprisingly, still alive.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
movl   $0x1,(%rax)
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"La la la...\0ACrash time now.\0A\00"
@.str.1 = [28 x i8] c"Surprisingly, still alive.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* null
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"La la la...\0ACrash time now.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char const *, char const *, size_t);
bool is_str_eq(const char *s1, size_t n1, const char *s2, size_t n2) {
  if (n1 != n2) {
    return false;
  }
  return !memcmp(s1, s2, ((n1) < (n2) ? (n1) : (n2)));
}


x86 assembly (clang, -O0):
<is_str_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1142 <is_str_eq+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1196 <is_str_eq+0x86>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    116d <is_str_eq+0x5d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1175 <is_str_eq+0x65>
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_str_eq>:
xor    %eax,%eax
cmp    %rcx,%rsi
jne    1133 <is_str_eq+0x23>
push   %rax
mov    %rsi,%r8
mov    %rdx,%rsi
mov    %r8,%rdx
call   1030 <bcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @is_str_eq(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i32 @bcmp(i8* %0, i8* %2, i64 %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %6
%11 = phi i32 [ %9, %6 ], [ 0, %4 ]
ret i32 %11
}
int test_imm_C5int64_highword_reg(long long val) {
  return ((val >> 32) & (0xC5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C5int64_highword_reg>:
movabs $0xc500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C5int64_highword_reg(i64 %0) {
%2 = and i64 %0, 846108557312
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ShrTest8(unsigned C) { return -1 >> C; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @_s_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
void const *tor_memmem(void const *, size_t, char const *, int /*<<< orphan*/);
const void *tor_memstr(const void *haystack, size_t hlen, const char *needle) {
  return tor_memmem(haystack, hlen, needle, strlen(needle));
}


x86 assembly (clang, -O0):
<tor_memstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1030 <tor_memmem@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_memstr>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <tor_memmem@plt>

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

LLVM IR (-O2):
define i8* @tor_memstr(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i8* @tor_memmem(i8* %0, i64 %1, i8* %2, i32 %4)
ret i8* %5
}
/* Variables and functions */
long errno;
long int __syscall_error(long int err) {
  errno = err;
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    0x2ecd(%rip),%rax
mov    %rcx,(%rax)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
mov    0x2ed9(%rip),%rax
mov    %rdi,(%rax)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@errno = global i64 0
define i64 @__syscall_error(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store i64 %3, i64* @errno
ret i64 -1
}

LLVM IR (-O2):
@errno = global i64 0
define i64 @__syscall_error(i64 %0) {
store i64 %0, i64* @errno
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int cpufreq_open(void) {
  int fd;
  if ((fd = open("/proc/sys/cpu/0/speed", O_RDWR)) < 0) {
    syslog(LOG_INFO, "Failed to open cpufreq device!");
    return (-1);
  }
  return (fd);
}


x86 assembly (clang, -O0):
<cpufreq_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    116a <cpufreq_open+0x4a>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <cpufreq_open+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_open>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
test   %eax,%eax
js     113c <cpufreq_open+0x1c>
pop    %rcx
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <syslog@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/proc/sys/cpu/0/speed\00"
@O_RDWR = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [31 x i8] c"Failed to open cpufreq device!\00"
define i32 @cpufreq_open() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @LOG_INFO
%8 = call i32 @syslog(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [22 x i8] c"/proc/sys/cpu/0/speed\00"
@O_RDWR = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [31 x i8] c"Failed to open cpufreq device!\00"
define i32 @cpufreq_open() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @LOG_INFO
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ -1, %4 ], [ %2, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void **, void *);
int /*<<< orphan*/ stderr;
void bad_layout(void **variable_ptr, void *fp) {
  fprintf(stderr,
          "First variable should be allocated one word below "
          "the frame.  Got variable's address %p, frame at %p instead.\n",
          variable_ptr, fp);
  abort();
}


x86 assembly (clang, -O0):
<bad_layout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<bad_layout>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [111 x i8] c"First variable should be allocated one word below the frame. Got variable's address %p, frame at %p instead.\0A\00"
define void @bad_layout(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8** %6, i8* %7)
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [111 x i8] c"First variable should be allocated one word below the frame. Got variable's address %p, frame at %p instead.\0A\00"
define void @bad_layout(i8** %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8** %0, i8* %1)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern int num_pes(void) { printf("\nOpenSHMEM Analyzer\n"); }


x86 assembly (clang, -O0):
<num_pes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i32 @num_pes() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i32 @num_pes() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void w6(void *x, long long y) { *(long long *)(x + 32762) = y; }


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

x86 assembly (clang, -O2):
<w6>:
mov    %rsi,0x7ffa(%rdi)
ret

LLVM IR (-O0):
define void @w6(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32762
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w6(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32762
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
/* Type definitions */
struct fd_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ basename(char *);
int dup(int);
int /*<<< orphan*/ strcmp(int /*<<< orphan*/, char *);
int log_open(struct fd_info *info, const char *pathname) {
  if (!strcmp(basename((char *)pathname), "ncsvc.log")) {
    do {
    } while (0);
    return dup(1);
  } else
    return -5555;
}


x86 assembly (clang, -O0):
<log_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
lea    0xeae(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    117c <log_open+0x4c>
jmp    1165 <log_open+0x35>
jmp    116a <log_open+0x3a>
mov    $0x1,%edi
call   1030 <dup@plt>
mov    %eax,-0x4(%rbp)
jmp    1183 <log_open+0x53>
movl   $0xffffea4d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open>:
push   %rax
mov    %rsi,%rdi
call   1050 <basename@plt>
lea    0xec0(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1152 <log_open+0x22>
mov    $0xffffea4d,%eax
pop    %rcx
ret
mov    $0x1,%edi
pop    %rax
jmp    1030 <dup@plt>

LLVM IR (-O0):
%struct.fd_info = type { i32 }
@.str = [10 x i8] c"ncsvc.log\00"
define i32 @log_open(%struct.fd_info* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.fd_info*
%5 = alloca i8*
store %struct.fd_info* %0, %struct.fd_info** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @basename(i8* %6)
%8 = call i32 @strcmp(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %2
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = call i32 @dup(i32 1)
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 -5555, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.fd_info = type { i32 }
@.str = [10 x i8] c"ncsvc.log\00"
define i32 @log_open(%struct.fd_info* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @basename(i8* %1)
%4 = tail call i32 @strcmp(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @dup(i32 1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -5555, %2 ]
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_Newton_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(199, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_Newton_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xc7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_Newton_step>:
mov    $0xc7,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @standard_Newton_step() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 199, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @standard_Newton_step() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 199, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
double sqrt(double);
double dbr_len3v(double *a) {
  return sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]);
}


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

x86 assembly (clang, -O2):
<dbr_len3v>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <dbr_len3v+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @dbr_len3v(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ drv_base_flush();
void drv_base_flush_box(int lft, int top, int rgt, int bot) {
  drv_base_flush();
}


x86 assembly (clang, -O0):
<drv_base_flush_box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <drv_base_flush@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @drv_base_flush_box(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 (...) @drv_base_flush()
ret void
}

LLVM IR (-O2):
define void @drv_base_flush_box(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @drv_base_flush()
ret void
}
double radius_effective(int mode, double radius_lg, double radius_sm,
                        double penetration) {
  switch (mode) {
  default:
  case 1:
    return radius_lg;
  case 2:
    return radius_lg + 2.0 * radius_sm - penetration;
  }
}


x86 assembly (clang, -O0):
<radius_effective>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x1,%eax
je     1140 <radius_effective+0x40>
jmp    112a <radius_effective+0x2a>
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
je     114f <radius_effective+0x4f>
jmp    113b <radius_effective+0x3b>
jmp    1140 <radius_effective+0x40>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116b <radius_effective+0x6b>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_effective>:
cmp    $0x2,%edi
jne    1115 <radius_effective+0x15>
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @radius_effective(i32 %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load i32, i32* %6
switch i32 %10, label %11 [
i32 1, label %12
i32 2, label %14
]
11: ; preds = %4
br label %12
12: ; preds = %4, %11
%13 = load double, double* %7
store double %13, double* %5
br label %20
14: ; preds = %4
%15 = load double, double* %7
%16 = load double, double* %8
%17 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %16, double %15)
%18 = load double, double* %9
%19 = fsub double %17, %18
store double %19, double* %5
br label %20
20: ; preds = %14, %12
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @radius_effective(i32 %0, double %1, double %2, double %3) {
%5 = icmp eq i32 %0, 2
%6 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %1)
%7 = fsub double %6, %3
%8 = select i1 %5, double %7, double %1
ret double %8
}
void sk_unshift(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_unshift() {
ret void
}
/* Variables and functions */
scalar_t__ scan_file(char *);
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; i++) {
    if (scan_file(argv[i]) < 0)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <main+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <scan_file@plt>
cmp    $0x0,%rax
jge    1159 <main+0x49>
jmp    116c <main+0x5c>
jmp    115e <main+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     114b <main+0x3b>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x8(%r14,%rbx,8),%rdi
call   1030 <scan_file@plt>
test   %rax,%rax
js     114b <main+0x3b>
lea    0x1(%rbx),%rax
cmp    %r15,%rbx
mov    %rax,%rbx
jb     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %6, %4
%7 = phi i64 [ %12, %6 ], [ 1, %4 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @scan_file(i8* %9)
%11 = icmp sgt i64 %10, -1
%12 = add nuw nsw i64 %7, 1
%13 = icmp ult i64 %12, %5
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Shift(int, int /*<<< orphan*/, int, int /*<<< orphan*/);
void HighGear() { Shift(1, 0, 1, 0); }


x86 assembly (clang, -O0):
<HighGear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <Shift@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HighGear>:
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    1030 <Shift@plt>

LLVM IR (-O0):
define void @HighGear() {
%1 = call i32 @Shift(i32 1, i32 0, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @HighGear() {
%1 = tail call i32 @Shift(i32 1, i32 0, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(int tam, int array[]) {
  if (tam == 0) {
    return;
  } else {
    printf("\n%d\n", array[tam - 1]);
    tam = tam - 1;
    printArray(tam, array);
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113e <printArray+0x1e>
jmp    116f <printArray+0x4f>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <printArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     1155 <printArray+0x45>
mov    %edi,%r15d
movslq %edi,%rax
neg    %r15d
lea    (%rsi,%rax,4),%r12
add    $0xfffffffffffffffc,%r12
xor    %ebx,%ebx
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r15d
jne    1140 <printArray+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
define void @printArray(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = trunc i64 %8 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Continuation_cache_destroy();
int /*<<< orphan*/ NonceKey_cache_destroy();
int /*<<< orphan*/ ParsedPMinisock_cache_destroy();
void StateCache_destroy(void) {
  ParsedPMinisock_cache_destroy();
  Continuation_cache_destroy();
  NonceKey_cache_destroy();
}


x86 assembly (clang, -O0):
<StateCache_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ParsedPMinisock_cache_destroy@plt>
mov    $0x0,%al
call   1040 <Continuation_cache_destroy@plt>
mov    $0x0,%al
call   1050 <NonceKey_cache_destroy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StateCache_destroy>:
push   %rax
xor    %eax,%eax
call   1030 <ParsedPMinisock_cache_destroy@plt>
xor    %eax,%eax
call   1040 <Continuation_cache_destroy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <NonceKey_cache_destroy@plt>

LLVM IR (-O0):
define void @StateCache_destroy() {
%1 = call i32 (...) @ParsedPMinisock_cache_destroy()
%2 = call i32 (...) @Continuation_cache_destroy()
%3 = call i32 (...) @NonceKey_cache_destroy()
ret void
}

LLVM IR (-O2):
define void @StateCache_destroy() {
%1 = tail call i32 (...) @ParsedPMinisock_cache_destroy()
%2 = tail call i32 (...) @Continuation_cache_destroy()
%3 = tail call i32 (...) @NonceKey_cache_destroy()
ret void
}