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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen_safe(char *, char *);
float **load_2d_float_array(int *, int *, int /*<<< orphan*/ *);
float **load_plsa_unigram_models_from_file(char *filein, int *num_features_ptr,
                                           int *num_topics_ptr) {
  FILE *fp = fopen_safe(filein, "r");
  float **array = load_2d_float_array(num_features_ptr, num_topics_ptr, fp);
  fclose(fp);
  return array;
}


x86 assembly (clang, -O0):
<load_plsa_unigram_models_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <fopen_safe@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <load_2d_float_array@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_plsa_unigram_models_from_file>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebe(%rip),%rsi
call   1030 <fopen_safe@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <load_2d_float_array@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define float** @load_plsa_unigram_models_from_file(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca float**
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i8*, i8** %4
%10 = call i32* @fopen_safe(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %7
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = load i32*, i32** %7
%14 = call float** @load_2d_float_array(i32* %11, i32* %12, i32* %13)
store float** %14, float*** %8
%15 = load i32*, i32** %7
%16 = call i32 @fclose(i32* %15)
%17 = load float**, float*** %8
ret float** %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define float** @load_plsa_unigram_models_from_file(i8* %0, i32* %1, i32* %2) {
%4 = tail call i32* @fopen_safe(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call float** @load_2d_float_array(i32* %1, i32* %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret float** %5
}
const char *_Locale_monetary_default(char *__DUMMY_PAR) { return 0; }


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

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

LLVM IR (-O0):
define i8* @_Locale_monetary_default(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_monetary_default(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
struct utimbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int utime(const char *path, const struct utimbuf *times) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.utimbuf = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = alloca i8*
%4 = alloca %struct.utimbuf*
store i8* %0, i8** %3
store %struct.utimbuf* %1, %struct.utimbuf** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.utimbuf = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @utime(i8* nocapture readnone %0, %struct.utimbuf* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void XQueryFont() {}


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

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

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

LLVM IR (-O2):
define void @XQueryFont() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RESHLm(int);
void RES6HLm() { RESHLm(0x40); }


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

x86 assembly (clang, -O2):
<RES6HLm>:
mov    $0x40,%edi
jmp    1030 <RESHLm@plt>

LLVM IR (-O0):
define void @RES6HLm() {
%1 = call i32 @RESHLm(i32 64)
ret void
}

LLVM IR (-O2):
define void @RES6HLm() {
%1 = tail call i32 @RESHLm(i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void UART0_IRQHandler(void) {
  UART0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @UART0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @UART0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @UART0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @UART0_DriverIRQHandler()
ret void
}
int f_blg_cr2(float a1) { return !(__builtin_islessgreater(100, a1)); }


x86 assembly (clang, -O0):
<f_blg_cr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blg_cr2>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @f_blg_cr2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp one float 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_blg_cr2(float %0) {
%2 = fcmp ueq float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_permute2x128_si256(int /*<<< orphan*/,
                                             int /*<<< orphan*/, int);
__attribute__((always_)) __m256i _mm256_unpackhi_epi128(__m256i a, __m256i b) {
  return _mm256_permute2x128_si256(a, b, 0x31);
}


x86 assembly (clang, -O0):
<_mm256_unpackhi_epi128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x31,%edx
call   1030 <_mm256_permute2x128_si256@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm256_unpackhi_epi128>:
mov    $0x31,%edx
jmp    1030 <_mm256_permute2x128_si256@plt>

LLVM IR (-O0):
define i32 @_mm256_unpackhi_epi128(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 = load i32, i32* %4
%7 = call i32 @_mm256_permute2x128_si256(i32 %5, i32 %6, i32 49)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_mm256_unpackhi_epi128(i32 %0, i32 %1) {
%3 = tail call i32 @_mm256_permute2x128_si256(i32 %0, i32 %1, i32 49)
ret i32 %3
}
/* Variables and functions */
int mt_genrand_int32();
int mtrandom_int(int range) {
  if (range == 0)
    return range;
  return mt_genrand_int32() % range;
}


x86 assembly (clang, -O0):
<mtrandom_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1130 <mtrandom_int+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <mtrandom_int+0x2e>
mov    $0x0,%al
call   1030 <mt_genrand_int32@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtrandom_int>:
test   %edi,%edi
je     1125 <mtrandom_int+0x15>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <mt_genrand_int32@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mtrandom_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @mt_genrand_int32()
%5 = srem i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
ri() { esc("M"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"M\00"
define i32 @ri() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f();
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ g();
char *mkstr(char *);
int main() {
  char *a = mkstr("Hallo"), *b;
  (void)mkstr("Test");
  f();
  b = mkstr("Test");
  g();
  a[6] = 0;
  free(b);
  free(a);
  exit(0);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <mkstr@plt>
mov    %rax,-0x10(%rbp)
lea    0xe90(%rip),%rdi
call   1050 <mkstr@plt>
mov    $0x0,%al
call   1040 <f@plt>
lea    0xe7d(%rip),%rdi
call   1050 <mkstr@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <g@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0x6(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xea4(%rip),%rdi
call   1050 <mkstr@plt>
mov    %rax,%r15
lea    0xe9b(%rip),%r14
mov    %r14,%rdi
call   1050 <mkstr@plt>
xor    %eax,%eax
call   1040 <f@plt>
mov    %r14,%rdi
call   1050 <mkstr@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <g@plt>
movb   $0x0,0x6(%r15)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Hallo\00"
@.str.1 = [5 x i8] c"Test\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @mkstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = call i8* @mkstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @f()
%7 = call i8* @mkstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %3
%8 = call i32 (...) @g()
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 6
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hallo\00"
@.str.1 = [5 x i8] c"Test\00"
define i32 @main() {
%1 = tail call i8* @mkstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @mkstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @f()
%4 = tail call i8* @mkstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @g()
%6 = getelementptr inbounds i8, i8* %1, i64 6
store i8 0, i8* %6
%7 = tail call i32 @free(i8* %4)
%8 = tail call i32 @free(i8* %1)
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("FAIL!\n");
  printf("Program should have exited due to the magic m5_exit"
         " instruction!\n");
  return -1;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"FAIL!\0A\00"
@.str.1 = [66 x i8] c"Program should have exited due to the magic m5_exit instruction!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [6 x i8] c"FAIL!\00"
@str.2 = [65 x i8] c"Program should have exited due to the magic m5_exit instruction!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.2, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int form_getv(char const *, char *, int *);
int form_geti(const char *name, int *var) { return form_getv(name, "%d", var); }


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

x86 assembly (clang, -O2):
<form_geti>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <form_getv@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @form_geti(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 i32 @form_getv(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @form_geti(i8* %0, i32* %1) {
%3 = tail call i32 @form_getv(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
char *makeMonthTxt(int ts, char *txt) {
  strftime(txt, 9, "%b %Y", localtime((time_t *)&ts));
  return txt;
}


x86 assembly (clang, -O0):
<makeMonthTxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x9,%esi
lea    0xeae(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeMonthTxt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%b %Y\00"
define i8* @makeMonthTxt(i32 %0, i8* returned %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @localtime(i32* %3)
%5 = call i32 @strftime(i8* %1, i32 9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_atid(char *atid) {
  write("msproject.xml", "\t<TaskUID>%s</TaskUID>\n", atid);
}


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

x86 assembly (clang, -O2):
<function_atid>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [24 x i8] c"\09<TaskUID>%s</TaskUID>\0A\00"
define void @function_atid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [24 x i8] c"\09<TaskUID>%s</TaskUID>\0A\00"
define void @function_atid(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int mdaq_file_lseek(int fd, long offset, int whence) { return 0; }


x86 assembly (clang, -O0):
<mdaq_file_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mdaq_file_lseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @mdaq_file_lseek(i32 %0, i64 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_preamble_ctl_usage(void) {
  printf("\nUsage : sys_cfg_preamble_ctl\n");
  return;
}


x86 assembly (clang, -O0):
<print_sys_cfg_preamble_ctl_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"\0AUsage : sys_cfg_preamble_ctl\0A\00"
define void @print_sys_cfg_preamble_ctl_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"\0AUsage : sys_cfg_preamble_ctl\00"
define void @print_sys_cfg_preamble_ctl_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void NotSupportMethod() {
  fprintf(stderr, "Method not support!\n");
  return;
}


x86 assembly (clang, -O0):
<NotSupportMethod>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Method not support!\0A\00"
define void @NotSupportMethod() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Method not support!\0A\00"
define void @NotSupportMethod() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void UART8_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @UART8_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @UART8_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shared_types_global_initGlobalMutexesFor1Module_0();
void shared_types_global_initAllGlobalMutexes_0(void) {
  shared_types_global_initGlobalMutexesFor1Module_0();
}


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

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

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

LLVM IR (-O2):
define void @shared_types_global_initAllGlobalMutexes_0() {
%1 = tail call i32 (...) @shared_types_global_initGlobalMutexesFor1Module_0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_message(char *message) {
  fprintf(stderr, "ERROR: %s", message);
  exit(1);
}


x86 assembly (clang, -O0):
<error_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_message>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"ERROR: %s\00"
define void @error_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"ERROR: %s\00"
define void @error_message(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned long compare_and_swap64(unsigned long long volatile *,
                                 unsigned long long, unsigned long long);
unsigned long compare_and_swap_ptr(volatile void *address, void *old_ptr,
                                   void *new_ptr) {
  return compare_and_swap64((volatile unsigned long long *)address,
                            (unsigned long long)old_ptr,
                            (unsigned long long)new_ptr);
}


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

x86 assembly (clang, -O2):
<compare_and_swap_ptr>:
jmp    1030 <compare_and_swap64@plt>

LLVM IR (-O0):
define i64 @compare_and_swap_ptr(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = call i64 @compare_and_swap64(i64* %8, i64 %10, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @compare_and_swap_ptr(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = tail call i64 @compare_and_swap64(i64* %4, i64 %5, i64 %6)
ret i64 %7
}
/* Variables and functions */
int *alloca(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ memcpy(int *, int *, int);
void dup(int *p, int size) {
  int *temp, i;
  getchar();
  temp = alloca(size);
  getchar();
  memcpy(temp, p, size);
  for (i = 0; i < 5; i++)
    temp[i] = i + 10;
}


x86 assembly (clang, -O0):
<dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0xc(%rbp),%edi
call   1040 <alloca@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    1199 <dup+0x69>
mov    -0x1c(%rbp),%edx
add    $0xa,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1170 <dup+0x40>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %ebp,%edi
call   1040 <alloca@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
movaps 0xe9b(%rip),%xmm0
movups %xmm0,(%rbx)
movl   $0xe,0x10(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @dup(i32* %0, i32 %1) {
%3 = tail call i32 (...) @getchar()
%4 = tail call i32* @alloca(i32 %1)
%5 = tail call i32 (...) @getchar()
%6 = tail call i32 @memcpy(i32* %4, i32* %0, i32 %1)
%7 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 10, i32 11, i32 12, i32 13>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %4, i64 4
store i32 14, i32* %8
ret void
}
long long int isprime(long long int n) {
  long long int i, j, k;
  j = 0;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      j = 1;
      break;
    }
  }
  if (j == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1162 <isprime+0x62>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    114c <isprime+0x4c>
movq   $0x1,-0x20(%rbp)
jmp    1162 <isprime+0x62>
jmp    1151 <isprime+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <isprime+0x18>
cmpq   $0x0,-0x20(%rbp)
jne    117a <isprime+0x7a>
movq   $0x1,-0x8(%rbp)
jmp    1182 <isprime+0x82>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%eax
cmp    $0x4,%rdi
jl     1153 <isprime+0x53>
mov    $0x2,%ecx
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1130 <isprime+0x30>
mov    %rdi,%rax
cqto
idiv   %rcx
test   %rdx,%rdx
jne    113b <isprime+0x3b>
jmp    114b <isprime+0x4b>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
test   %rdx,%rdx
je     114b <isprime+0x4b>
add    $0x1,%rcx
mov    %rcx,%rax
imul   %rcx,%rax
cmp    %rdi,%rax
jle    1110 <isprime+0x10>
xor    %eax,%eax
test   %rdx,%rdx
setne  %al
ret

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

LLVM IR (-O2):
define i64 @isprime(i64 %0) {
%2 = icmp slt i64 %0, 4
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 2, %1 ]
%5 = srem i64 %0, %4
%6 = icmp eq i64 %5, 0
%7 = add nuw nsw i64 %4, 1
%8 = mul nsw i64 %7, %7
%9 = icmp sgt i64 %8, %0
%10 = select i1 %6, i1 true, i1 %9
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = xor i1 %6, true
%13 = zext i1 %12 to i64
br label %14
14: ; preds = %11, %1
%15 = phi i64 [ 1, %1 ], [ %13, %11 ]
ret i64 %15
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
scalar_t__ calc_tree(struct tree *);
double op_greater(struct tree *left, struct tree *right) {
  return calc_tree(left) > calc_tree(right);
}


x86 assembly (clang, -O0):
<op_greater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_tree@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <calc_tree@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_greater>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <calc_tree@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <calc_tree@plt>
cmp    %rax,%rbx
jg     1131 <op_greater+0x21>
xorps  %xmm0,%xmm0
jmp    1139 <op_greater+0x29>
movsd  0xec7(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_greater(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call i64 @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call i64 @calc_tree(%struct.tree* %7)
%9 = icmp sgt i64 %6, %8
%10 = zext i1 %9 to i32
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_greater(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call i64 @calc_tree(%struct.tree* %0)
%4 = tail call i64 @calc_tree(%struct.tree* %1)
%5 = icmp sgt i64 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
/* Variables and functions */
scalar_t__ __floatdidf(long long);
long __floatdisf(register long long a1) { return (long)__floatdidf(a1); }


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

x86 assembly (clang, -O2):
<__floatdisf>:
jmp    1030 <__floatdidf@plt>

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

LLVM IR (-O2):
define i64 @__floatdisf(i64 %0) {
%2 = tail call i64 @__floatdidf(i64 %0)
ret i64 %2
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
int lc_get_host_info(char *host_name, struct hostent **hpp) {
  struct hostent *hp;
  int rv = 0;
  hp = gethostbyname(host_name);
  if (hp == (struct hostent *)NULL)
    rv = 1;
  else
    *hpp = hp;
  return rv;
}


x86 assembly (clang, -O0):
<lc_get_host_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114b <lc_get_host_info+0x3b>
movl   $0x1,-0x1c(%rbp)
jmp    1156 <lc_get_host_info+0x46>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lc_get_host_info>:
push   %rbx
mov    %rsi,%rbx
call   1030 <gethostbyname@plt>
test   %rax,%rax
je     1125 <lc_get_host_info+0x15>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
define i32 @lc_get_host_info(i8* %0, %struct.hostent** %1) {
%3 = alloca i8*
%4 = alloca %struct.hostent**
%5 = alloca %struct.hostent*
%6 = alloca i32
store i8* %0, i8** %3
store %struct.hostent** %1, %struct.hostent*** %4
store i32 0, i32* %6
%7 = load i8*, i8** %3
%8 = call %struct.hostent* @gethostbyname(i8* %7)
store %struct.hostent* %8, %struct.hostent** %5
%9 = load %struct.hostent*, %struct.hostent** %5
%10 = icmp eq %struct.hostent* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %6
br label %15
12: ; preds = %2
%13 = load %struct.hostent*, %struct.hostent** %5
%14 = load %struct.hostent**, %struct.hostent*** %4
store %struct.hostent* %13, %struct.hostent** %14
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @lc_get_host_info(i8* %0, %struct.hostent** nocapture writeonly %1) {
%3 = tail call %struct.hostent* @gethostbyname(i8* %0)
%4 = icmp eq %struct.hostent* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store %struct.hostent* %3, %struct.hostent** %1
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %7
}
void nrerror(char error_text[]) { return; }


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

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

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

LLVM IR (-O2):
define void @nrerror(i8* nocapture %0) {
ret void
}
int yas_l3g4200d_lock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yas_l3g4200d_lock() {
ret i32 0
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
int _getchar(void) {
  static char ch;
  return (read(0, &ch, 1) == 1) ? ch : (-1);
}


x86 assembly (clang, -O0):
<_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    0x2f08(%rip),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1143 <_getchar+0x33>
movsbl 0x2eee(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <_getchar+0x40>
mov    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <_getchar+0x40>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getchar>:
push   %rax
lea    0x2f11(%rip),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movsbl 0x2efb(%rip),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_getchar.ch = internal global i8 0
define i32 @_getchar() {
%1 = call i32 @read(i32 0, i8* @_getchar.ch, i32 1)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i8, i8* @_getchar.ch
%5 = sext i8 %4 to i32
br label %7
6: ; preds = %0
br label %7
7: ; preds = %6, %3
%8 = phi i32 [ %5, %3 ], [ -1, %6 ]
ret i32 %8
}

LLVM IR (-O2):
@_getchar.ch = internal global i8 0
define i32 @_getchar() {
%1 = tail call i32 @read(i32 0, i8* @_getchar.ch, i32 1)
%2 = icmp eq i32 %1, 1
%3 = load i8, i8* @_getchar.ch
%4 = sext i8 %3 to i32
%5 = select i1 %2, i32 %4, i32 -1
ret i32 %5
}
/* Variables and functions */
double fabs(float);
float my_sinf(float);
float wrap_sinf(float x) {
  if (fabs(x) < 3.4526697709225118160247802734375e-4)
    return 0;
  return my_sinf(x);
}


x86 assembly (clang, -O0):
<wrap_sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1159 <wrap_sinf+0x39>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1168 <wrap_sinf+0x48>
movss  -0x8(%rbp),%xmm0
call   1040 <my_sinf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_sinf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <fabs@plt>
movsd  0xecc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1140 <wrap_sinf+0x20>
xorpd  %xmm0,%xmm0
pop    %rax
ret
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <my_sinf@plt>

LLVM IR (-O0):
define float @wrap_sinf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call double @fabs(float %4)
%6 = fcmp olt double %5, 0x3F36A09E60000000
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = call float @my_sinf(float %9)
store float %10, float* %2
br label %11
11: ; preds = %8, %7
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @wrap_sinf(float %0) {
%2 = tail call double @fabs(float %0)
%3 = fcmp olt double %2, 0x3F36A09E60000000
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call float @my_sinf(float %0)
br label %6
6: ; preds = %1, %4
%7 = phi float [ %5, %4 ], [ 0.000000e+00, %1 ]
ret float %7
}
double *fct_0(double *a, double *b, double *c, double *d, double *e, double *f,
              double *g, double *h) {
  (void)a;
  (void)b;
  (void)c;
  (void)d;
  (void)e;
  (void)f;
  (void)g;
  (void)h;
  return a;
}


x86 assembly (clang, -O0):
<fct_0>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define double* @fct_0(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
%17 = load double*, double** %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load double*, double** %13
%22 = load double*, double** %14
%23 = load double*, double** %15
%24 = load double*, double** %16
%25 = load double*, double** %9
ret double* %25
}

LLVM IR (-O2):
define double* @fct_0(double* readnone returned %0, double* nocapture readnone %1, double* nocapture readnone %2, double* nocapture readnone %3, double* nocapture readnone %4, double* nocapture readnone %5, double* nocapture readnone %6, double* nocapture readnone %7) {
ret double* %0
}
/* Variables and functions */
int __futex(void volatile *, int, int, int /*<<< orphan*/ *);
int __futex_wake(volatile void *ftx, int count) {
  return __futex(ftx, 1, count, NULL);
}


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

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

LLVM IR (-O0):
define i32 @__futex_wake(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 i32 @__futex(i8* %5, i32 1, i32 %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__futex_wake(i8* %0, i32 %1) {
%3 = tail call i32 @__futex(i8* %0, i32 1, i32 %1, i32* null)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int ch) {
  if (isupper(ch))
    return ch ^ 0x20;
  return ch;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = xor i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ polybench_flush_cache();
void polybench_prepare_instruments() { polybench_flush_cache(); }


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

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

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

LLVM IR (-O2):
define void @polybench_prepare_instruments() {
%1 = tail call i32 (...) @polybench_flush_cache()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, long);
void _greenlet_dealloc_stack(void *stack, long size) { munmap(stack, size); }


x86 assembly (clang, -O0):
<_greenlet_dealloc_stack>:
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 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_greenlet_dealloc_stack>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @_greenlet_dealloc_stack(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
char *K256Head(char *Key) {
  char *r;
  r = (*Key & 0x80) ? Key + 1 : Key;
  return r;
}


x86 assembly (clang, -O0):
<K256Head>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112e <K256Head+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <K256Head+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<K256Head>:
movzbl (%rdi),%eax
shr    $0x7,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @K256Head(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
br label %14
12: ; preds = %1
%13 = load i8*, i8** %2
br label %14
14: ; preds = %12, %9
%15 = phi i8* [ %11, %9 ], [ %13, %12 ]
store i8* %15, i8** %3
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @K256Head(i8* %0) {
%2 = load i8, i8* %0
%3 = lshr i8 %2, 7
%4 = zext i8 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
int get_salt_size(void) { return 512; }


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

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

LLVM IR (-O0):
define i32 @get_salt_size() {
ret i32 512
}

LLVM IR (-O2):
define i32 @get_salt_size() {
ret i32 512
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Sub1() { printf("In Sub1\n"); }


x86 assembly (clang, -O0):
<Sub1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"In Sub1\0A\00"
define void @Sub1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"In Sub1\00"
define void @Sub1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void *thread_function(void *arg) {
  asm("nop");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
nop
jmp    1109 <thread_function+0x9>

x86 assembly (clang, -O2):
<thread_function>:
nop
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1110 <thread_function+0x10>

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define i8* @thread_function(i8* nocapture readnone %0) {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %2
2: ; preds = %1, %2
br label %2
}