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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void close_the_file(FILE *fp, char comment[]) {
  fprintf(fp, "%s!ENDOFREGISTRYGENERATEDFILE\n", comment);
  fclose(fp);
}


x86 assembly (clang, -O0):
<close_the_file>:
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    0xec1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_the_file>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s!ENDOFREGISTRYGENERATEDFILE\0A\00"
define void @close_the_file(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s!ENDOFREGISTRYGENERATEDFILE\0A\00"
define void @close_the_file(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @fclose(i32* %0)
ret void
}
float *search(float (*pointer)[4], int n) {
  float *pt;
  pt = *(pointer + n);
  return (pt);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
movslq %esi,%rax
shl    $0x4,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define float* @search([4 x float]* %0, i32 %1) {
%3 = alloca [4 x float]*
%4 = alloca i32
%5 = alloca float*
store [4 x float]* %0, [4 x float]** %3
store i32 %1, i32* %4
%6 = load [4 x float]*, [4 x float]** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 %8
%10 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 0
store float* %10, float** %5
%11 = load float*, float** %5
ret float* %11
}

LLVM IR (-O2):
define float* @search([4 x float]* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %3, i64 0
ret float* %4
}
/* Variables and functions */
int /*<<< orphan*/ quicksort(void *, void *, size_t,
                             int (*)(void const *, void const *));
void qsort(void *base, size_t nmemb, size_t size,
           int (*compar)(const void *, const void *)) {
  quicksort(base, base + (nmemb - 1) * size, size, compar);
}


x86 assembly (clang, -O0):
<qsort>:
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    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
imul   -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
add    $0xffffffffffffffff,%rsi
imul   %rdx,%rsi
add    %rdi,%rsi
jmp    1030 <quicksort@plt>

LLVM IR (-O0):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = sub i64 %11, 1
%13 = load i64, i64* %7
%14 = mul i64 %12, %13
%15 = getelementptr i8, i8* %10, i64 %14
%16 = load i64, i64* %7
%17 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%18 = call i32 @quicksort(i8* %9, i8* %15, i64 %16, i32 (i8*, i8*)* %17)
ret void
}

LLVM IR (-O2):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = add i64 %1, -1
%6 = mul i64 %5, %2
%7 = getelementptr i8, i8* %0, i64 %6
%8 = tail call i32 @quicksort(i8* %0, i8* %7, i64 %2, i32 (i8*, i8*)* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vp8_variance(unsigned char *, int, unsigned char *, int, int,
                                int, unsigned int *, int *);
unsigned int vp8_get16x16var_c(unsigned char *src_ptr, int source_stride,
                               unsigned char *ref_ptr, int recon_stride,
                               unsigned int *SSE, int *Sum) {
  vp8_variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, SSE, Sum);
  return (*SSE - (((*Sum) * (*Sum)) >> 8));
}


x86 assembly (clang, -O0):
<vp8_get16x16var_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r10
mov    -0x30(%rbp),%rax
mov    $0x10,%r9d
mov    %r9d,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <vp8_variance@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x30(%rbp),%rdx
imul   (%rdx),%ecx
sar    $0x8,%ecx
sub    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_get16x16var_c>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%rbx
mov    $0x10,%r8d
mov    $0x10,%r9d
push   %r14
push   %rbx
call   1030 <vp8_variance@plt>
add    $0x10,%rsp
mov    (%rbx),%eax
mov    (%r14),%ecx
imul   %ecx,%ecx
shr    $0x8,%ecx
sub    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @vp8_get16x16var_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32*, i32** %12
%19 = call i32 @vp8_variance(i8* %13, i32 %14, i8* %15, i32 %16, i32 16, i32 16, i32* %17, i32* %18)
%20 = load i32*, i32** %11
%21 = load i32, i32* %20
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = load i32*, i32** %12
%25 = load i32, i32* %24
%26 = mul nsw i32 %23, %25
%27 = ashr i32 %26, 8
%28 = sub i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @vp8_get16x16var_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4, i32* %5) {
%7 = tail call i32 @vp8_variance(i8* %0, i32 %1, i8* %2, i32 %3, i32 16, i32 16, i32* %4, i32* %5)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, %9
%11 = lshr i32 %10, 8
%12 = sub i32 %8, %11
ret i32 %12
}
void merge_locks(int *l) { ; }


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

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

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

LLVM IR (-O2):
define void @merge_locks(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int xxxxx(int start) {
  int i = start;
  volatile unsigned long *gpmcon = (volatile unsigned long *)0x7F008820;
  volatile unsigned long *gpmdat = (volatile unsigned long *)0x7F008824;
  *gpmcon = 0x1111;
  while (1) {
    *gpmdat = i;
    i++;
    if (i == 16)
      i = 0;
    delay(0x10000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<xxxxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x7f008820,%eax
mov    %rax,-0x10(%rbp)
mov    $0x7f008824,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1111,(%rax)
movslq -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jne    1163 <xxxxx+0x53>
movl   $0x0,-0x8(%rbp)
mov    $0x10000,%edi
call   1030 <delay@plt>
jmp    113e <xxxxx+0x2e>

x86 assembly (clang, -O2):
<xxxxx>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movq   $0x1111,0x7f008820
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %ebx,%rbx
mov    %rbx,0x7f008824
7f
add    $0x1,%ebx
cmp    $0x10,%ebx
cmove  %ebp,%ebx
mov    $0x10000,%edi
call   1030 <delay@plt>
jmp    1130 <xxxxx+0x20>

LLVM IR (-O0):
define i32 @xxxxx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64*
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
store i64* inttoptr (i64 2130741280 to i64*), i64** %4
store i64* inttoptr (i64 2130741284 to i64*), i64** %5
%7 = load i64*, i64** %4
store volatile i64 4369, i64* %7
br label %8
8: ; preds = %1, %17
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = load i64*, i64** %5
store volatile i64 %10, i64* %11
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 16
br i1 %15, label %16, label %17
16: ; preds = %8
store i32 0, i32* %3
br label %17
17: ; preds = %16, %8
%18 = call i32 @delay(i32 65536)
br label %8
}

LLVM IR (-O2):
define i32 @xxxxx(i32 %0) {
store volatile i64 4369, i64* inttoptr (i64 2130741280 to i64*)
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %7, %2 ]
%4 = sext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 2130741284 to i64*)
%5 = add nsw i32 %3, 1
%6 = icmp eq i32 %5, 16
%7 = select i1 %6, i32 0, i32 %5
%8 = tail call i32 @delay(i32 65536)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ mlMatrixCopy(float *, float *);
int /*<<< orphan*/ mlMatrixScaleTo(float *, float const *, float *);
void mlMatrixScale(float *a, const float *b) {
  float result[16];
  mlMatrixScaleTo(a, b, result);
  mlMatrixCopy(result, a);
}


x86 assembly (clang, -O0):
<mlMatrixScale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1030 <mlMatrixScaleTo@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <mlMatrixCopy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlMatrixScale>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1030 <mlMatrixScaleTo@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <mlMatrixCopy@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mlMatrixScale(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [16 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%9 = call i32 @mlMatrixScaleTo(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%11 = load float*, float** %3
%12 = call i32 @mlMatrixCopy(float* %10, float* %11)
ret void
}

LLVM IR (-O2):
define void @mlMatrixScale(float* %0, float* %1) {
%3 = alloca [16 x float]
%4 = bitcast [16 x float]* %3 to i8*
%5 = getelementptr inbounds [16 x float], [16 x float]* %3, i64 0, i64 0
%6 = call i32 @mlMatrixScaleTo(float* %0, float* %1, float* %5)
%7 = call i32 @mlMatrixCopy(float* %5, float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void SDMMemoryAllocError(const char *ErrorString) {
  printf("Fatal Error - Could not allocate memory!\n  Error: %s\n",
         ErrorString);
  _exit(-1);
}


x86 assembly (clang, -O0):
<SDMMemoryAllocError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<SDMMemoryAllocError>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Fatal Error - Could not allocate memory!\0A Error: %s\0A\00"
define void @SDMMemoryAllocError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [54 x i8] c"Fatal Error - Could not allocate memory!\0A Error: %s\0A\00"
define void @SDMMemoryAllocError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
char *langDbgDevTms99x8A() { return "TMS99x8A"; }


x86 assembly (clang, -O0):
<langDbgDevTms99x8A>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgDevTms99x8A>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"TMS99x8A\00"
define i8* @langDbgDevTms99x8A() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"TMS99x8A\00"
define i8* @langDbgDevTms99x8A() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void swap64(uint64_t *x, uint64_t *y) {
  uint64_t tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap64(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ FermerFichier(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void testFermerFichier() {
  FILE *fichier;
  FermerFichier(fichier);
  if (1) {
    printf("%%TEST_FAILED%% time=0 testname=testFermerFichier "
           "(Test_gestionfichier) message=error message sample\n");
  }
}


x86 assembly (clang, -O0):
<testFermerFichier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1030 <FermerFichier@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFermerFichier>:
push   %rax
call   1030 <FermerFichier@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [102 x i8] c"%%TEST_FAILED%% time=0 testname=testFermerFichier (Test_gestionfichier) message=error message sample\0A\00"
define void @testFermerFichier() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @FermerFichier(i32* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [102 x i8] c"%%TEST_FAILED%% time=0 testname=testFermerFichier (Test_gestionfichier) message=error message sample\0A\00"
define void @testFermerFichier() {
%1 = tail call i32 @FermerFichier(i32* undef)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ INT64_MAX;
scalar_t__ unknown_int();
void plus_one_Good() {
  int64_t x = unknown_int();
  if (x < INT64_MAX) {
    int64_t y = x + 1;
  }
}


x86 assembly (clang, -O0):
<plus_one_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
jge    1143 <plus_one_Good+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@INT64_MAX = global i64 0
define void @plus_one_Good() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @unknown_int()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = load i64, i64* @INT64_MAX
%6 = icmp slt i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i64, i64* %1
%9 = add nsw i64 %8, 1
store i64 %9, i64* %2
br label %10
10: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@INT64_MAX = global i64 0
define void @plus_one_Good() {
%1 = tail call i64 (...) @unknown_int()
ret void
}
void foo_2_1_1_1_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_2_1_2_2() {
ret void
}
int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define i32 @rt2x00rfkill_allocate(%struct.rt2x00_dev* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double wtime(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec + 1e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<wtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @wtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @wtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ default_print_time(unsigned long long);
int /*<<< orphan*/ printf(char *);
void default_println_time(unsigned long long time) {
  default_print_time(time);
  printf("\n");
}


x86 assembly (clang, -O0):
<default_println_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <default_print_time@plt>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_println_time>:
push   %rax
call   1040 <default_print_time@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @default_println_time(i64 %0) {
%2 = tail call i32 @default_print_time(i64 %0)
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int EAST_BL(int in) {
  FILE *fin = fopen("func_header.h.ecov", "a");
  if (fin) {
    fprintf(fin, "BL%d:1\n", in);
  }
  fclose(fin);
  return in;
}


x86 assembly (clang, -O0):
<EAST_BL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <EAST_BL+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EAST_BL>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <EAST_BL+0x31>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"BL%d:1\0A\00"
define i32 @EAST_BL(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"BL%d:1\0A\00"
define i32 @EAST_BL(i32 returned %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fclose(i32* %2)
ret i32 %0
}
/* Variables and functions */
scalar_t__ compare_func(int, int);
int /*<<< orphan*/ swap(int, int);
void bubble_up(int p_current_node) {
  if (p_current_node == 0)
    return;
  int parent = (p_current_node - 1) / 2;
  if (compare_func(p_current_node, parent)) {
    swap(p_current_node, parent);
    bubble_up(parent);
  }
}


x86 assembly (clang, -O0):
<bubble_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114a <bubble_up+0x1a>
jmp    1183 <bubble_up+0x53>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <compare_func@plt>
cmp    $0x0,%rax
je     1183 <bubble_up+0x53>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <swap@plt>
mov    -0x8(%rbp),%edi
call   1030 <bubble_up@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bubble_up>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     115c <bubble_up+0x3c>
mov    %edi,%ebx
nopl   0x0(%rax)
lea    -0x1(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xffffffff,%ebp
sar    %ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <compare_func@plt>
test   %rax,%rax
je     115c <bubble_up+0x3c>
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <swap@plt>
cmp    $0x2,%ebx
mov    %ebp,%ebx
ja     1130 <bubble_up+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @bubble_up(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = sdiv i32 %9, 2
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i64 @compare_func(i32 %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %7
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @swap(i32 %16, i32 %17)
%19 = load i32, i32* %3
br label %20
20: ; preds = %6, %15, %7
ret void
}

LLVM IR (-O2):
define void @bubble_up(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i32 [ %6, %9 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = sdiv i32 %5, 2
%7 = tail call i64 @compare_func(i32 %4, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = tail call i32 @swap(i32 %4, i32 %6)
%11 = icmp ult i32 %4, 3
br i1 %11, label %12, label %3
12: ; preds = %9, %3, %1
ret void
}
/* Variables and functions */
float fatorial(float);
double S(int x) {
  double r = 0;
  for (float i = 0; i <= x; i++) {
    r += (float)1 / (fatorial(i));
  }
  return r;
}


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     117c <S+0x6c>
movss  -0x14(%rbp),%xmm0
call   1030 <fatorial@plt>
movaps %xmm0,%xmm1
movss  0xead(%rip),%xmm0
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xe93(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    112b <S+0x1b>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
sub    $0x18,%rsp
test   %edi,%edi
js     1198 <S+0x88>
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
nopl   0x0(%rax)
movss  %xmm1,0x4(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
call   1030 <fatorial@plt>
movss  0xeb4(%rip),%xmm2
movaps %xmm2,%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x14(%rsp),%xmm1
ucomiss 0x4(%rsp),%xmm1
movss  0x4(%rsp),%xmm1
jae    1130 <S+0x20>
add    $0x18,%rsp
ret
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @S(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca float
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
store float 0.000000e+00, float* %4
br label %5
5: ; preds = %17, %1
%6 = load float, float* %4
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to float
%9 = fcmp ole float %6, %8
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load float, float* %4
%12 = call float @fatorial(float %11)
%13 = fdiv float 1.000000e+00, %12
%14 = fpext float %13 to double
%15 = load double, double* %3
%16 = fadd double %15, %14
store double %16, double* %3
br label %17
17: ; preds = %10
%18 = load float, float* %4
%19 = fadd float %18, 1.000000e+00
store float %19, float* %4
br label %5
20: ; preds = %5
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @S(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi double [ 0.000000e+00, %1 ], [ %12, %6 ]
ret double %5
6: ; preds = %1, %6
%7 = phi float [ %13, %6 ], [ 0.000000e+00, %1 ]
%8 = phi double [ %12, %6 ], [ 0.000000e+00, %1 ]
%9 = tail call float @fatorial(float %7)
%10 = fdiv float 1.000000e+00, %9
%11 = fpext float %10 to double
%12 = fadd double %8, %11
%13 = fadd float %7, 1.000000e+00
%14 = fcmp ugt float %13, %2
br i1 %14, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printTriangleType(int type) {
  if (type == 0)
    printf(" Scalene");
  if (type == 1)
    printf(" Isosceles");
  if (type == 3)
    printf("n Equilateral");
}


x86 assembly (clang, -O0):
<printTriangleType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <printTriangleType+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1147 <printTriangleType+0x37>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0x4(%rbp)
jne    115d <printTriangleType+0x4d>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTriangleType>:
test   %edi,%edi
je     112a <printTriangleType+0x1a>
cmp    $0x3,%edi
je     1136 <printTriangleType+0x26>
cmp    $0x1,%edi
jne    1142 <printTriangleType+0x32>
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xed7(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c" Scalene\00"
@.str.1 = [11 x i8] c" Isosceles\00"
@.str.2 = [14 x i8] c"n Equilateral\00"
define void @printTriangleType(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %4
i32 1, label %2
i32 3, label %3
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ term_send(unsigned char);
void term_restore_cursor_position() {
  term_send(27);
  term_send('[');
  term_send('u');
}


x86 assembly (clang, -O0):
<term_restore_cursor_position>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x75,%edi
call   1030 <term_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_restore_cursor_position>:
push   %rax
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x75,%edi
pop    %rax
jmp    1030 <term_send@plt>

LLVM IR (-O0):
define void @term_restore_cursor_position() {
%1 = call i32 @term_send(i8 zeroext 27)
%2 = call i32 @term_send(i8 zeroext 91)
%3 = call i32 @term_send(i8 zeroext 117)
ret void
}

LLVM IR (-O2):
define void @term_restore_cursor_position() {
%1 = tail call i32 @term_send(i8 zeroext 27)
%2 = tail call i32 @term_send(i8 zeroext 91)
%3 = tail call i32 @term_send(i8 zeroext 117)
ret void
}
int to_errno(int err) { return err; }


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

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

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

LLVM IR (-O2):
define i32 @to_errno(i32 returned %0) {
ret i32 %0
}
void *dlopen(const char *filename, int flags) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlopen(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
__attribute__((always_)) unsigned long __ffs(unsigned long word) {
  asm("bsf %1,%0" : "=r"(word) : "rm"(word));
  return word;
}


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

x86 assembly (clang, -O2):
<__ffs>:
mov    %rdi,-0x8(%rsp)
bsf    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @__ffs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "bsf $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @__ffs(i64 %0) {
%2 = tail call i64 asm "bsf $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Variables and functions */
int strEqual(char *, char *);
int keys_are_equal(void *key1, void *key2) {
  return (strEqual((char *)key1, (char *)key2));
}


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

x86 assembly (clang, -O2):
<keys_are_equal>:
jmp    1030 <strEqual@plt>

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

LLVM IR (-O2):
define i32 @keys_are_equal(i8* %0, i8* %1) {
%3 = tail call i32 @strEqual(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ input_begin_frame();
void input_update() { input_begin_frame(); }


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

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

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

LLVM IR (-O2):
define void @input_update() {
%1 = tail call i32 (...) @input_begin_frame()
ret void
}
void fa35(int n) {
  {
    int b[n];
  a : {
    int c[n];
    goto a;
    0;
  }
    {
      int d[n];
      0;
    };
    int e[n];
    0;
  };
  {
    int f[n];
    {
      int g[n];
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
jmp    111c <fa35+0x1c>

x86 assembly (clang, -O2):
<fa35>:
jmp    1100 <fa35>

LLVM IR (-O0):
define void @fa35(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
br label %23
23: ; preds = %23, %1
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
store i8* %26, i8** %5
%27 = alloca i32, i64 %25
store i64 %25, i64* %6
%28 = load i8*, i8** %5
br label %23
29: ; No predecessors!
%30 = load i32, i32* %2
%31 = zext i32 %30 to i64
%32 = call i8* @llvm.stacksave()
store i8* %32, i8** %7
%33 = alloca i32, i64 %31
store i64 %31, i64* %8
%34 = load i8*, i8** %7
%35 = load i32, i32* %2
%36 = zext i32 %35 to i64
%37 = alloca i32, i64 %36
store i64 %36, i64* %9
%38 = load i8*, i8** %3
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
%41 = call i8* @llvm.stacksave()
store i8* %41, i8** %10
%42 = alloca i32, i64 %40
store i64 %40, i64* %11
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
%45 = call i8* @llvm.stacksave()
store i8* %45, i8** %12
%46 = alloca i32, i64 %44
store i64 %44, i64* %13
%47 = load i8*, i8** %12
%48 = load i32, i32* %2
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
store i8* %50, i8** %14
%51 = alloca i32, i64 %49
store i64 %49, i64* %15
%52 = load i8*, i8** %14
%53 = load i32, i32* %2
%54 = zext i32 %53 to i64
%55 = alloca i32, i64 %54
store i64 %54, i64* %16
%56 = load i8*, i8** %10
%57 = load i32, i32* %2
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %17
%60 = alloca i32, i64 %58
store i64 %58, i64* %18
%61 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa35(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
const char *C_Float_Definition(void) {
  return "struct C_Float {\n"
         "  double (*c_float)(var);\n"
         "};\n";
}


x86 assembly (clang, -O0):
<C_Float_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Float_Definition>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"struct C_Float {\0A double (*c_float)(var);\0A};\0A\00"
define i8* @C_Float_Definition() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"struct C_Float {\0A double (*c_float)(var);\0A};\0A\00"
define i8* @C_Float_Definition() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("My Name is: Gabriel Sorensen\nI am a Computer Science Major in my "
         "junior year.\nI enjoy programming and playing video games.");
}


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

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

LLVM IR (-O0):
@.str = [123 x i8] c"My Name is: Gabriel Sorensen\0AI am a Computer Science Major in my junior year.\0AI enjoy programming and playing video games.\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [123 x i8] c"My Name is: Gabriel Sorensen\0AI am a Computer Science Major in my junior year.\0AI enjoy programming and playing video games.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void duplicate_carry(void) { printf("\tCOPY_CARRY;\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"\09COPY_CARRY;\00"
define void @duplicate_carry() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MOTOR_ON_OFF_SaveConfig();
void MOTOR_ON_OFF_Sleep(void) { MOTOR_ON_OFF_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @MOTOR_ON_OFF_Sleep() {
%1 = tail call i32 (...) @MOTOR_ON_OFF_SaveConfig()
ret void
}
void numlock_set_on() {}


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

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

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

LLVM IR (-O2):
define void @numlock_set_on() {
ret void
}
/* Type definitions */
typedef long uint64_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
uint64_t timespec_to_nsec(const struct timespec *ts) {
  uint64_t res;
  res = 1000000000L * (unsigned long long)ts->tv_sec;
  res += ts->tv_nsec;
  return res;
}


x86 assembly (clang, -O0):
<timespec_to_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,0x8(%rax),%rax
3b
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_nsec>:
imul   $0x3b9aca00,0x8(%rdi),%rax
3b
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_nsec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca i64
store %struct.timespec* %0, %struct.timespec** %2
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = mul i64 1000000000, %6
store i64 %7, i64* %3
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = load i64, i64* %3
%12 = add nsw i64 %11, %10
store i64 %12, i64* %3
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_nsec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
char *langRomTypeWaveSCSI512() { return "512kB WAVE-SCSI"; }


x86 assembly (clang, -O0):
<langRomTypeWaveSCSI512>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeWaveSCSI512>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"512kB WAVE-SCSI\00"
define i8* @langRomTypeWaveSCSI512() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"512kB WAVE-SCSI\00"
define i8* @langRomTypeWaveSCSI512() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
void eap_tls_deinit_for_reauth(struct eap_sm *sm, void *priv) {}


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

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

LLVM IR (-O0):
%struct.eap_sm = type opaque
define void @eap_tls_deinit_for_reauth(%struct.eap_sm* %0, i8* %1) {
%3 = alloca %struct.eap_sm*
%4 = alloca i8*
store %struct.eap_sm* %0, %struct.eap_sm** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.eap_sm = type opaque
define void @eap_tls_deinit_for_reauth(%struct.eap_sm* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncmp(char *, char *, int);
void strncmp_0() {
  char *x = "123";
  char *y = "123";
  clang_analyzer_eval(strncmp(x, y, 3) == 0);
}


x86 assembly (clang, -O0):
<strncmp_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_0>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strncmp_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncmp(i8* %3, i8* %4, i32 3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strncmp_0() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}