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

/* Variables and functions */
int /*<<< orphan*/ _mm256_add_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m256d __attribute__((__target__("avx")))
mm256_add_pd_wrap(__m256d a, __m256d b) {
  return _mm256_add_pd(a, b);
}


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

x86 assembly (clang, -O2):
<mm256_add_pd_wrap>:
jmp    1030 <_mm256_add_pd@plt>

LLVM IR (-O0):
define i32 @mm256_add_pd_wrap(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_add_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mm256_add_pd_wrap(i32 %0, i32 %1) {
%3 = tail call i32 @_mm256_add_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32enc(int /*<<< orphan*/ *, int /*<<< orphan*/);
void be64enc(void *buf, uint64_t u) {
  uint8_t *p = buf;
  be32enc(p, ((uint32_t)(u >> 32)));
  be32enc(p + 4, ((uint32_t)(u & 0xffffffffULL)));
}


x86 assembly (clang, -O0):
<be64enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <be32enc@plt>
mov    -0x18(%rbp),%rdi
add    $0x10,%rdi
movslq -0xc(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%esi
call   1030 <be32enc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64enc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <be32enc@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <be32enc@plt>

LLVM IR (-O0):
define void @be64enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = ashr i32 %9, 32
%11 = call i32 @be32enc(i32* %8, i32 %10)
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = and i64 %15, 4294967295
%17 = trunc i64 %16 to i32
%18 = call i32 @be32enc(i32* %13, i32 %17)
ret void
}

LLVM IR (-O2):
define void @be64enc(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @be32enc(i32* %3, i32 poison)
%5 = getelementptr inbounds i8, i8* %0, i64 16
%6 = bitcast i8* %5 to i32*
%7 = tail call i32 @be32enc(i32* %6, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int std_fclose(FILE *fp) {
  int stat;
  if ((stat = fclose(fp)) != 0) {
    perror("fclose");
    exit(1);
  }
  return stat;
}


x86 assembly (clang, -O0):
<std_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1167 <std_fclose+0x37>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_fclose>:
push   %rax
call   1030 <fclose@plt>
test   %eax,%eax
jne    113e <std_fclose+0xe>
xor    %eax,%eax
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"fclose\00"
define i32 @std_fclose(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fclose(i32* %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"fclose\00"
define i32 @std_fclose(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_lockdir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_lockdir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_lockdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_lockdir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void baz_double(double *x) { *x = __imag foo_double(5); }


x86 assembly (clang, -O0):
<baz_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <foo_double@plt>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz_double>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_double@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @baz_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo_double to i32 (i32, ...)*)(i32 5)
%4 = load double*, double** %2
store double 0.000000e+00, double* %4
ret void
}

LLVM IR (-O2):
define void @baz_double(double* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_double to i32 (i32, ...)*)(i32 5)
store double 0.000000e+00, double* %0
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ quit(char *);
int /*<<< orphan*/ sprintf(char *, char *, size_t);
void *cmalloc(size_t msize) {
  void *p;
  char msg[15];
  if (!(p = calloc(msize, (size_t)1))) {
    sprintf(msg, "malloc(%ld) failed", msize);
    quit(msg);
  }
  return p;
}


x86 assembly (clang, -O0):
<cmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1175 <cmalloc+0x45>
lea    -0x1f(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x1f(%rbp),%rdi
call   1030 <quit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116d <cmalloc+0x3d>
lea    0xeab(%rip),%rsi
lea    0x1(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %r15,%rdi
call   1030 <quit@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"malloc(%ld) failed\00"
define i8* @cmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca [15 x i8]
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i8* @calloc(i64 %5, i64 1)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%10 = load i64, i64* %2
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%13 = call i32 @quit(i8* %12)
br label %14
14: ; preds = %8, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [19 x i8] c"malloc(%ld) failed\00"
define noalias i8* @cmalloc(i64 %0) {
%2 = alloca [15 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @calloc(i64 %0, i64 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = call i32 @quit(i8* %3)
br label %9
9: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ kprintlnc(char const *, int);
void kprintln(const char *string) { kprintlnc(string, 15); }


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

x86 assembly (clang, -O2):
<kprintln>:
mov    $0xf,%esi
jmp    1030 <kprintlnc@plt>

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

LLVM IR (-O2):
define void @kprintln(i8* %0) {
%2 = tail call i32 @kprintlnc(i8* %0, i32 15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
void debug_print_string(const char *s) {
  FILE *f = fopen("debug", "a+");
  fputs(s, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<debug_print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_print_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"debug\00"
@.str.1 = [3 x i8] c"a+\00"
define void @debug_print_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8*, i8** %2
%6 = load i32*, i32** %3
%7 = call i32 @fputs(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"debug\00"
@.str.1 = [3 x i8] c"a+\00"
define void @debug_print_string(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fputs(i8* %0, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("Usage: ./yumwrapper check-update|update|clean|list|localinstall "
         "[package]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"Usage: ./yumwrapper check-update|update|clean|list|localinstall [package]\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [74 x i8] c"Usage: ./yumwrapper check-update|update|clean|list|localinstall [package]\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void prefetch(const void *x) { ; }


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

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

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

LLVM IR (-O2):
define void @prefetch(i8* nocapture %0) {
ret void
}
void writeClose(void) {
  int *IO = (int *)(0x3c000000 + 4 * 0x00000020);
  *(IO + 1) = 1;
}


x86 assembly (clang, -O0):
<writeClose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c000080,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeClose>:
movl   $0x1,0x3c000084
ret

LLVM IR (-O0):
define void @writeClose() {
%1 = alloca i32*
store i32* inttoptr (i64 1006633088 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @writeClose() {
store i32 1, i32* inttoptr (i64 1006633092 to i32*)
ret void
}
long proc3(long p1, int p2, short p3) { return p1 + p2 + p3; }


x86 assembly (clang, -O0):
<proc3>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
movswq -0xe(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc3>:
movslq %esi,%rcx
add    %rdi,%rcx
movslq %edx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @proc3(i64 %0, i32 %1, i16 signext %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i16
store i64 %0, i64* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
%11 = load i16, i16* %6
%12 = sext i16 %11 to i64
%13 = add nsw i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @proc3(i64 %0, i32 %1, i16 signext %2) {
%4 = sext i32 %1 to i64
%5 = add nsw i64 %4, %0
%6 = sext i16 %2 to i64
%7 = add nsw i64 %5, %6
ret i64 %7
}
/* Variables and functions */
bool Boolean_0_toBoolean_2_Boolean(bool value) { return value; }


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

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

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

LLVM IR (-O2):
define i32 @Boolean_0_toBoolean_2_Boolean(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void timerStart(struct timeval *time) { gettimeofday(time, NULL); }


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

x86 assembly (clang, -O2):
<timerStart>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @timerStart(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
void TestAppP$Leds$led0On(void) { LedsP$Leds$led0On(); }


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

x86 assembly (clang, -O2):
<TestAppP$Leds$led0On>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led0On@plt>

LLVM IR (-O0):
define void @"TestAppP$Leds$led0On"() {
%1 = call i32 (...) @"LedsP$Leds$led0On"()
ret void
}

LLVM IR (-O2):
define void @"TestAppP$Leds$led0On"() {
%1 = tail call i32 (...) @"LedsP$Leds$led0On"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char const *);
int is_folder_exist(const char *path) {
  DIR *dp = NULL;
  if ((dp = opendir(path)) == NULL) {
    return 0;
  }
  closedir(dp);
  return 1;
}


x86 assembly (clang, -O0):
<is_folder_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1157 <is_folder_exist+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <is_folder_exist+0x47>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_folder_exist>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <is_folder_exist+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_folder_exist(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void MultiMon_Destroy() {}


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

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

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

LLVM IR (-O2):
define void @MultiMon_Destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int age;
  scanf("%d\n", &age);
  if (age > 20) {
    printf("yes\n");
  } else {
    printf("no\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x14,-0x8(%rbp)
jle    115a <main+0x3a>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x15,0x4(%rsp)
lea    0xec9(%rip),%rax
lea    0xebf(%rip),%rdi
cmovge %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 20
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 20
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
int fz_difference_byte(int bd, int s) {
  return ((bd - s) < 0 ? -(bd - s) : (bd - s));
}


x86 assembly (clang, -O0):
<fz_difference_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jge    112b <fz_difference_byte+0x2b>
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <fz_difference_byte+0x34>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_difference_byte>:
sub    %esi,%edi
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @fz_difference_byte(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 = sub nsw i32 %5, %6
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = sub nsw i32 0, %12
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sub nsw i32 %15, %16
br label %18
18: ; preds = %14, %9
%19 = phi i32 [ %13, %9 ], [ %17, %14 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @fz_difference_byte(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int32_t pn_int32_t(int32_t i) {
  printf("%d\n", i);
  return i;
}


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

x86 assembly (clang, -O2):
<pn_int32_t>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @pn_int32_t(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
double random();
double xt_core_gray_coin_toss() { return ((double)random()) / (random()); }


x86 assembly (clang, -O0):
<xt_core_gray_coin_toss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_gray_coin_toss>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xt_core_gray_coin_toss() {
%1 = call double (...) @random()
%2 = call double (...) @random()
%3 = fdiv double %1, %2
ret double %3
}

LLVM IR (-O2):
define double @xt_core_gray_coin_toss() {
%1 = tail call double (...) @random()
%2 = tail call double (...) @random()
%3 = fdiv double %1, %2
ret double %3
}
/* Variables and functions */
int PAPI_assign_eventset_component(int, int);
void papif_assign_eventset_component__(int *EventSet, int *cidx, int *check) {
  *check = PAPI_assign_eventset_component(*EventSet, *cidx);
}


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

x86 assembly (clang, -O2):
<papif_assign_eventset_component__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <PAPI_assign_eventset_component@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_assign_eventset_component__(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @PAPI_assign_eventset_component(i32 %4, i32 %5)
store i32 %6, i32* %2
ret void
}
/* Type definitions */
struct textseq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int textseq_cursor_charat(struct textseq *seq, unsigned offset) {
  assert(seq != NULL);
  return offset;
}


x86 assembly (clang, -O0):
<textseq_cursor_charat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textseq_cursor_charat>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.textseq = type { i32 }
define i32 @textseq_cursor_charat(%struct.textseq* %0, i32 %1) {
%3 = alloca %struct.textseq*
%4 = alloca i32
store %struct.textseq* %0, %struct.textseq** %3
store i32 %1, i32* %4
%5 = load %struct.textseq*, %struct.textseq** %3
%6 = icmp ne %struct.textseq* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.textseq = type { i32 }
define i32 @textseq_cursor_charat(%struct.textseq* readnone %0, i32 returned %1) {
%3 = icmp ne %struct.textseq* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 %1
}
/* Variables and functions */
int open_listenfd(int);
int /*<<< orphan*/ unix_error(char *);
int Open_listenfd(int port) {
  int n;
  if ((n = open_listenfd(port)) < 0)
    unix_error("Open_listenfd error");
  return n;
}


x86 assembly (clang, -O0):
<Open_listenfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <open_listenfd@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <Open_listenfd+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open_listenfd>:
push   %rbx
call   1040 <open_listenfd@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Open_listenfd+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Open_listenfd error\00"
define i32 @Open_listenfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @open_listenfd(i32 %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"Open_listenfd error\00"
define i32 @Open_listenfd(i32 %0) {
%2 = tail call i32 @open_listenfd(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dump_2d_float_array(float **, int, int,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ dump_strings(char **, int, int /*<<< orphan*/ *);
void save_distance_matrix(float **matrix, char **labels, int num_elements,
                          FILE *fp) {
  dump_2d_float_array(matrix, num_elements, num_elements, fp);
  dump_strings(labels, num_elements, fp);
}


x86 assembly (clang, -O0):
<save_distance_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <dump_2d_float_array@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <dump_strings@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_distance_matrix>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edx,%esi
call   1040 <dump_2d_float_array@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <dump_strings@plt>

LLVM IR (-O0):
define void @save_distance_matrix(float** %0, i8** %1, i32 %2, i32* %3) {
%5 = alloca float**
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32*
store float** %0, float*** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load float**, float*** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @dump_2d_float_array(float** %9, i32 %10, i32 %11, i32* %12)
%14 = load i8**, i8*** %6
%15 = load i32, i32* %7
%16 = load i32*, i32** %8
%17 = call i32 @dump_strings(i8** %14, i32 %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @save_distance_matrix(float** %0, i8** %1, i32 %2, i32* %3) {
%5 = tail call i32 @dump_2d_float_array(float** %0, i32 %2, i32 %2, i32* %3)
%6 = tail call i32 @dump_strings(i8** %1, i32 %2, i32* %3)
ret void
}
double Ts_T_fix(double s __attribute__((unused)), double alpha) {
  return alpha;
}


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

x86 assembly (clang, -O2):
<Ts_T_fix>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Ts_T_fix(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @Ts_T_fix(double %0, double returned %1) {
ret double %1
}
short int foo(long int x) { return x; }


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

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

LLVM IR (-O0):
define signext i16 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @foo(i64 %0) {
%2 = trunc i64 %0 to i16
ret i16 %2
}
double dsquare(double x) { return x * x; }


x86 assembly (clang, -O0):
<dsquare>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsquare>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dsquare(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @dsquare(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcie_aspm_create_sysfs_dev_files(%struct.pci_dev* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void I2CMasterIntClear(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000001C))) = 0x00000001;
  (*((volatile uint32_t *)(ui32Base + 0x00000018))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CMasterIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1c,%eax
cltq
movl   $0x1,(%rax)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntClear>:
movslq %edi,%rax
movl   $0x1,0x1c(%rax)
movl   $0x1,0x18(%rax)
ret

LLVM IR (-O0):
define void @I2CMasterIntClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 28
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 1, i32* %6
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 24
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 1, i32* %10
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntClear(i32 %0) {
%2 = add nsw i32 %0, 28
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 1, i32* %4
%5 = add nsw i32 %0, 24
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 1, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void plugin_set_rotor(double azimuth, double elevation) {
  printf("Azimuth: %f deg - Elevation: %f deg\n", azimuth, elevation);
}


x86 assembly (clang, -O0):
<plugin_set_rotor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [37 x i8] c"Azimuth: %f deg - Elevation: %f deg\0A\00"
define void @plugin_set_rotor(double %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %0, double %1)
ret void
}
void FUNC_LINEAR_BLIT_END(void) {}


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

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

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

LLVM IR (-O2):
define void @FUNC_LINEAR_BLIT_END() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ W_InitMultipleFiles(char **);
void W_InitFile(char *filename) {
  char *names[2];
  names[0] = filename;
  names[1] = NULL;
  W_InitMultipleFiles(names);
}


x86 assembly (clang, -O0):
<W_InitFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <W_InitMultipleFiles@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<W_InitFile>:
sub    $0x18,%rsp
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <W_InitMultipleFiles@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @W_InitFile(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x i8*]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
store i8* %4, i8** %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 1
store i8* null, i8** %6
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%8 = call i32 @W_InitMultipleFiles(i8** %7)
ret void
}

LLVM IR (-O2):
define void @W_InitFile(i8* %0) {
%2 = alloca [2 x i8*]
%3 = bitcast [2 x i8*]* %2 to i8*
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
store i8* %0, i8** %4
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 1
store i8* null, i8** %5
%6 = call i32 @W_InitMultipleFiles(i8** %4)
ret void
}
void cgi_uninit() {}


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

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

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

LLVM IR (-O2):
define void @cgi_uninit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, unsigned long long);
void formatUInt64(char *buffer, size_t size, char *format,
                  unsigned long long v) {
  snprintf(buffer, size, format, v);
}


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

x86 assembly (clang, -O2):
<formatUInt64>:
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
define void @formatUInt64(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @snprintf(i8* %9, i64 %10, i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
define void @formatUInt64(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @snprintf(i8* %0, i64 %1, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int __guest_munmap(int /*<<< orphan*/, void *, size_t);
int /*<<< orphan*/ munmap;
int guest_munmap(void *addr, size_t len) {
  return __guest_munmap(munmap, addr, len);
}


x86 assembly (clang, -O0):
<guest_munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <__guest_munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guest_munmap>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__guest_munmap@plt>

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

LLVM IR (-O2):
@munmap = global i32 0
define i32 @guest_munmap(i8* %0, i64 %1) {
%3 = load i32, i32* @munmap
%4 = tail call i32 @__guest_munmap(i32 %3, i8* %0, i64 %1)
ret i32 %4
}
int main(void) {
  int *p;
  {
    int x;
    p = &x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parambinder_free(void *);
void *free_binder(void *p) {
  if (p)
    parambinder_free(p);
  return 0;
}


x86 assembly (clang, -O0):
<free_binder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_binder+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <parambinder_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_binder>:
test   %rdi,%rdi
je     111f <free_binder+0xf>
push   %rax
call   1030 <parambinder_free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @free_binder(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parambinder_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i8* null
}
/* Variables and functions */
float fminf(float, float);
void test_fminf(float *__restrict__ r, float *__restrict__ a,
                float *__restrict__ b) {
  int i;
  for (i = 0; i < (16 / sizeof(float)); i++)
    r[i] = fminf(a[i], b[i]);
}


x86 assembly (clang, -O0):
<test_fminf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    1178 <test_fminf+0x78>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_fminf+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fminf>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
movaps %xmm1,%xmm2
minps  %xmm0,%xmm2
cmpunordps %xmm0,%xmm0
andps  %xmm0,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @test_fminf(float* noalias nocapture writeonly %0, float* noalias nocapture %1, float* noalias nocapture %2) {
%4 = bitcast float* %1 to <4 x float>*
%5 = load <4 x float>, <4 x float>* %4
%6 = bitcast float* %2 to <4 x float>*
%7 = load <4 x float>, <4 x float>* %6
%8 = call <4 x float> @llvm.minnum.v4f32(<4 x float> %5, <4 x float> %7)
%9 = bitcast float* %0 to <4 x float>*
store <4 x float> %8, <4 x float>* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("uid = %d gid = %d\n", getuid(), getgid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getgid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getgid@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"uid = %d gid = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @getgid()
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"uid = %d gid = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @getgid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int test_offcut() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_offcut() {
ret i32 0
}
/* Variables and functions */
int bsd_syscall_listen(int, int);
int uptcp_listen(int s, int backlog) { return bsd_syscall_listen(s, backlog); }


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

x86 assembly (clang, -O2):
<uptcp_listen>:
jmp    1030 <bsd_syscall_listen@plt>

LLVM IR (-O0):
define i32 @uptcp_listen(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 @bsd_syscall_listen(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @uptcp_listen(i32 %0, i32 %1) {
%3 = tail call i32 @bsd_syscall_listen(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double _get_uint(const char *data, size_t pos) {
  unsigned int *buf = (unsigned int *)data;
  return ((double)buf[pos]);
}


x86 assembly (clang, -O0):
<_get_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_uint>:
mov    (%rdi,%rsi,4),%eax
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @_get_uint(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
%12 = uitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @_get_uint(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 %1
%5 = load i32, i32* %4
%6 = uitofp i32 %5 to double
ret double %6
}