xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_length_solution_intro(int k, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(202, &k, n, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_length_solution_intro>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xca,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @solcon_length_solution_intro(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 202, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
int *gridPointer(int *S, int i, int j) { return S + i * 50 + j; }


x86 assembly (clang, -O0):
<gridPointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x32,-0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gridPointer>:
imul   $0x32,%esi,%eax
cltq
lea    (%rdi,%rax,4),%rax
movslq %edx,%rcx
lea    (%rax,%rcx,4),%rax
ret

LLVM IR (-O0):
define i32* @gridPointer(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* %5
%9 = mul nsw i32 %8, 50
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
ret i32* %14
}

LLVM IR (-O2):
define i32* @gridPointer(i32* readnone %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 50
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
ret i32* %8
}
/* Variables and functions */
char *alloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *concat(char *s1, char *s2) {
  int n = strlen(s1);
  char *s = alloc(n + strlen(s2) + 1);
  strcpy(s, s1);
  strcpy(s + n, s2);
  return s;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
add    %eax,%edi
add    $0x1,%edi
call   1050 <alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %eax,%r12d
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r12,%rax,1),%edi
add    $0x1,%edi
call   1050 <alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
movslq %r12d,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 %9, %11
%13 = add nsw i32 %12, 1
%14 = call i8* @alloc(i32 %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %6
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8*, i8** %4
%23 = call i32 @strcpy(i8* %21, i8* %22)
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i8* @alloc(i32 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = tail call i32 @strcpy(i8* %10, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ c_nnpntd(double, double, double *);
void nnpntd_(double *x, double *y, double *point) { c_nnpntd(*x, *y, point); }


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

x86 assembly (clang, -O2):
<nnpntd_>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    %rdx,%rdi
jmp    1030 <c_nnpntd@plt>

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

LLVM IR (-O2):
define void @nnpntd_(double* nocapture %0, double* nocapture %1, double* %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = tail call i32 @c_nnpntd(double %4, double %5, double* %2)
ret void
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
int _getbit(struct bitmask const *, unsigned int);
int numa_bitmask_isbitset(const struct bitmask *bmp, unsigned int i) {
  return _getbit(bmp, i);
}


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

x86 assembly (clang, -O2):
<numa_bitmask_isbitset>:
jmp    1030 <_getbit@plt>

LLVM IR (-O0):
%struct.bitmask = type { i32 }
define i32 @numa_bitmask_isbitset(%struct.bitmask* %0, i32 %1) {
%3 = alloca %struct.bitmask*
%4 = alloca i32
store %struct.bitmask* %0, %struct.bitmask** %3
store i32 %1, i32* %4
%5 = load %struct.bitmask*, %struct.bitmask** %3
%6 = load i32, i32* %4
%7 = call i32 @_getbit(%struct.bitmask* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define i32 @numa_bitmask_isbitset(%struct.bitmask* %0, i32 %1) {
%3 = tail call i32 @_getbit(%struct.bitmask* %0, i32 %1)
ret i32 %3
}
void libvo_amrwbenc_init() {}


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

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

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

LLVM IR (-O2):
define void @libvo_amrwbenc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Parameters:\n");
  printf("-file <name>       file to do the test on\n");
  exit(-100);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Parameters:\0A\00"
@.str.1 = [43 x i8] c"-file <name> file to do the test on\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 -100)
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"Parameters:\00"
@str.2 = [42 x i8] c"-file <name> file to do the test on\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -100)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d \n%d \n", a * a, a * a * a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xeb2(%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>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d \0A%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %1
%10 = mul nsw i32 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d \0A%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dsyrk_(char *, char *, int *, int *, double const *,
                          double *, int *, double const *, double *, int *, int,
                          int);
void mydsyrk(char *uplo, char *trans, int *n, int *k, const double *alpha,
             double *a, int *lda, const double *beta, double *c, int *ldc) {
  dsyrk_(uplo, trans, n, k, alpha, a, lda, beta, c, ldc, 1, 1);
}


x86 assembly (clang, -O0):
<mydsyrk>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x68,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%rbx
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x1,0x20(%rsp)
movl   $0x1,0x28(%rsp)
call   1030 <dsyrk_@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mydsyrk>:
sub    $0x38,%rsp
movaps 0x40(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
movups %xmm1,0x10(%rsp)
movups %xmm0,(%rsp)
movl   $0x1,0x28(%rsp)
movl   $0x1,0x20(%rsp)
call   1030 <dsyrk_@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @mydsyrk(i8* %0, i8* %1, i32* %2, i32* %3, double* %4, double* %5, i32* %6, double* %7, double* %8, i32* %9) {
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32*
%18 = alloca double*
%19 = alloca double*
%20 = alloca i32*
store i8* %0, i8** %11
store i8* %1, i8** %12
store i32* %2, i32** %13
store i32* %3, i32** %14
store double* %4, double** %15
store double* %5, double** %16
store i32* %6, i32** %17
store double* %7, double** %18
store double* %8, double** %19
store i32* %9, i32** %20
%21 = load i8*, i8** %11
%22 = load i8*, i8** %12
%23 = load i32*, i32** %13
%24 = load i32*, i32** %14
%25 = load double*, double** %15
%26 = load double*, double** %16
%27 = load i32*, i32** %17
%28 = load double*, double** %18
%29 = load double*, double** %19
%30 = load i32*, i32** %20
%31 = call i32 @dsyrk_(i8* %21, i8* %22, i32* %23, i32* %24, double* %25, double* %26, i32* %27, double* %28, double* %29, i32* %30, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @mydsyrk(i8* %0, i8* %1, i32* %2, i32* %3, double* %4, double* %5, i32* %6, double* %7, double* %8, i32* %9) {
%11 = tail call i32 @dsyrk_(i8* %0, i8* %1, i32* %2, i32* %3, double* %4, double* %5, i32* %6, double* %7, double* %8, i32* %9, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_ADDDP(int r, int v) { C67_asm("ADDDP.L", v, r, v); }


x86 assembly (clang, -O0):
<C67_ADDDP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed2(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_ADDDP>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    %esi,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ADDDP.L\00"
define void @C67_ADDDP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"ADDDP.L\00"
define void @C67_ADDDP(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int ENOSYS;
int pthread_mutex_getprioceiling(const pthread_mutex_t *mutex,
                                 int *prioceiling) {
  return (ENOSYS);
}


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

x86 assembly (clang, -O2):
<pthread_mutex_getprioceiling>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_mutex_getprioceiling(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
swap(int *left, int *right) {
  int temp = *left;
  *left = *right;
  *right = temp;
}


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

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

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
/* Variables and functions */
scalar_t__ start(int, char *);
int main() {
  int val = 0;
  for (int i = 0; i < 100; i++) {
    val += start(10, "Test Overflow");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1163 <main+0x53>
mov    $0xa,%edi
lea    0xebd(%rip),%rsi
call   1030 <start@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x64,%ebp
lea    0xee1(%rip),%rbx
nop
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <start@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Test Overflow\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = call i64 @start(i32 10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Test Overflow\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i64 @start(i32 10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ zap(int /*<<< orphan*/);
main() {
  zap(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <zap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <zap@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @zap(i32 0)
ret i32 0
}
int do_095() { return 95; }


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

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

LLVM IR (-O0):
define i32 @do_095() {
ret i32 95
}

LLVM IR (-O2):
define i32 @do_095() {
ret i32 95
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_crc32_u64(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t geopm_crc32_u64(uint64_t begin, uint64_t key) {
  return _mm_crc32_u64(begin, key);
}


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

x86 assembly (clang, -O2):
<geopm_crc32_u64>:
jmp    1030 <_mm_crc32_u64@plt>

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

LLVM IR (-O2):
define i32 @geopm_crc32_u64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_crc32_u64(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int _ez_net_tcp_server(int, char *, int /*<<< orphan*/, int);
int ez_net_tcp_server(int port, char *bindaddr, int backlog) {
  return _ez_net_tcp_server(port, bindaddr, AF_INET, backlog);
}


x86 assembly (clang, -O0):
<ez_net_tcp_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
call   1030 <_ez_net_tcp_server@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_net_tcp_server>:
mov    %edx,%ecx
mov    0x2ecf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <_ez_net_tcp_server@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @ez_net_tcp_server(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* @AF_INET
%10 = load i32, i32* %6
%11 = call i32 @_ez_net_tcp_server(i32 %7, i8* %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @ez_net_tcp_server(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @AF_INET
%5 = tail call i32 @_ez_net_tcp_server(i32 %0, i8* %1, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
unsigned int round(double);
unsigned int lon2x(double lon) {
  return round((lon + 180.0) * 65535.0 / 360.0);
}


x86 assembly (clang, -O0):
<lon2x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lon2x>:
addsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
divsd  0xee8(%rip),%xmm0
jmp    1030 <round@plt>

LLVM IR (-O0):
define i32 @lon2x(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.800000e+02
%5 = fmul double %4, 6.553500e+04
%6 = fdiv double %5, 3.600000e+02
%7 = call i32 @round(double %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lon2x(double %0) {
%2 = fadd double %0, 1.800000e+02
%3 = fmul double %2, 6.553500e+04
%4 = fdiv double %3, 3.600000e+02
%5 = tail call i32 @round(double %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printstr(char *);
char *show(int);
void printall(int tbl_sz) {
  int i;
  char *s;
  for (i = 0; i < tbl_sz; i++)
    if ((s = show(i)) != 0)
      printstr(s);
}


x86 assembly (clang, -O0):
<printall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1170 <printall+0x50>
mov    -0x8(%rbp),%edi
call   1030 <show@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115d <printall+0x3d>
mov    -0x10(%rbp),%rdi
call   1040 <printstr@plt>
jmp    1162 <printall+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <printall+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printall>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    114d <printall+0x2d>
mov    %edi,%ebx
xor    %ebp,%ebp
jmp    1137 <printall+0x17>
nopl   (%rax)
add    $0x1,%ebp
cmp    %ebp,%ebx
je     114d <printall+0x2d>
mov    %ebp,%edi
call   1030 <show@plt>
test   %rax,%rax
je     1130 <printall+0x10>
mov    %rax,%rdi
call   1040 <printstr@plt>
jmp    1130 <printall+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @printall(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i8* @show(i32 %10)
store i8* %11, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = call i32 @printstr(i8* %14)
br label %16
16: ; preds = %13, %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @printall(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = tail call i8* @show(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @printstr(i8* %5)
br label %9
9: ; preds = %3, %7
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_4004(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_4004() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Type definitions */
struct red_reob {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
scalar_t__ read_index_packet(int /*<<< orphan*/ *, char *);
struct red_reob *read_reob(FILE *fp) {
  fseek(fp, -0x38, SEEK_END);
  return (struct red_reob *)read_index_packet(fp, "REOB");
}


x86 assembly (clang, -O0):
<read_reob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffc8,%esi
call   1030 <fseek@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <read_index_packet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_reob>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffc8,%esi
call   1030 <fseek@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <read_index_packet@plt>

LLVM IR (-O0):
%struct.red_reob = type { i32 }
@SEEK_END = global i32 0
@.str = [5 x i8] c"REOB\00"
define %struct.red_reob* @read_reob(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_END
%5 = call i32 @fseek(i32* %3, i32 -56, i32 %4)
%6 = load i32*, i32** %2
%7 = call i64 @read_index_packet(i32* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = inttoptr i64 %7 to %struct.red_reob*
ret %struct.red_reob* %8
}

LLVM IR (-O2):
%struct.red_reob = type { i32 }
@SEEK_END = global i32 0
@.str = [5 x i8] c"REOB\00"
define %struct.red_reob* @read_reob(i32* %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 -56, i32 %2)
%4 = tail call i64 @read_index_packet(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = inttoptr i64 %4 to %struct.red_reob*
ret %struct.red_reob* %5
}
void check_checksums(void) {}


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

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

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

LLVM IR (-O2):
define void @check_checksums() {
ret void
}
/* Variables and functions */
int mode_flags(int /*<<< orphan*/);
int /*<<< orphan*/ video_current_mode();
unsigned video_flags(void) { return mode_flags(video_current_mode()); }


x86 assembly (clang, -O0):
<video_flags>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <video_current_mode@plt>
mov    %eax,%edi
call   1040 <mode_flags@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_flags>:
push   %rax
xor    %eax,%eax
call   1030 <video_current_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mode_flags@plt>

LLVM IR (-O0):
define i32 @video_flags() {
%1 = call i32 (...) @video_current_mode()
%2 = call i32 @mode_flags(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @video_flags() {
%1 = tail call i32 (...) @video_current_mode()
%2 = tail call i32 @mode_flags(i32 %1)
ret i32 %2
}
/* Variables and functions */
void SD_NULL_PCSpkOn(bool on, int freq) {}


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

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

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

LLVM IR (-O2):
define void @SD_NULL_PCSpkOn(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
double exp(double);
double pow(double, double);
double FT(double FT) {
  double q5, b;
  if (FT > 10) {
    return 1;
  }
  b = -1.680 * pow(FT, 0.3325);
  q5 = 213.7 * exp(b);
  return q5;
}


x86 assembly (clang, -O0):
<FT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1156 <FT+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a4 <FT+0x84>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe77(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FT>:
push   %rax
ucomisd 0xedf(%rip),%xmm0
jbe    1135 <FT+0x15>
movsd  0xecd(%rip),%xmm0
pop    %rax
ret
movsd  0xed3(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xece(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @FT(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 1.000000e+01
br i1 %7, label %8, label %9
8: ; preds = %1
store double 1.000000e+00, double* %2
br label %17
9: ; preds = %1
%10 = load double, double* %3
%11 = call double @pow(double %10, double 3.325000e-01)
%12 = fmul double -1.680000e+00, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = call double @exp(double %13)
%15 = fmul double 2.137000e+02, %14
store double %15, double* %4
%16 = load double, double* %4
store double %16, double* %2
br label %17
17: ; preds = %9, %8
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @FT(double %0) {
%2 = fcmp ogt double %0, 1.000000e+01
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call double @pow(double %0, double 3.325000e-01)
%5 = fmul double %4, -1.680000e+00
%6 = tail call double @exp(double %5)
%7 = fmul double %6, 2.137000e+02
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
int tracepoint_probe_unregister(char *, void *);
__attribute__((always_)) int
unregister_trace_module_free(void (*probe)(struct module *mod)) {
  return tracepoint_probe_unregister("module_free", (void *)probe);
}


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

x86 assembly (clang, -O2):
<unregister_trace_module_free>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tracepoint_probe_unregister@plt>

LLVM IR (-O0):
%struct.module = type opaque
@.str = [12 x i8] c"module_free\00"
define i32 @unregister_trace_module_free(void (%struct.module*)* %0) {
%2 = alloca void (%struct.module*)*
store void (%struct.module*)* %0, void (%struct.module*)** %2
%3 = load void (%struct.module*)*, void (%struct.module*)** %2
%4 = bitcast void (%struct.module*)* %3 to i8*
%5 = call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.module = type opaque
@.str = [12 x i8] c"module_free\00"
define i32 @unregister_trace_module_free(void (%struct.module*)* %0) {
%2 = bitcast void (%struct.module*)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, int /*<<< orphan*/);
empty() { error("stack empty", 0); }


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

x86 assembly (clang, -O2):
<empty>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"stack empty\00"
define i32 @empty() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 undef
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i = INT_MIN;
  int j = i / -1;
  printf("INT_MIN (%d) / -1 = %d\n", i, j);
  return j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xffffffff,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    %esi,%ebx
neg    %ebx
lea    0xedb(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@.str = [24 x i8] c"INT_MIN (%d) / -1 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @INT_MIN
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, -1
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [24 x i8] c"INT_MIN (%d) / -1 = %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @INT_MIN
%2 = sub i32 0, %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void WatchdogIntEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000008))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntEnable>:
orq    $0x1,0x8(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @WatchdogIntEnable(i64 %0) {
%2 = add nsw i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1
store volatile i64 %5, i64* %3
ret void
}
unsigned int hash(const char *string) {
  unsigned int hashval = 0;
  while (*string != '\0')
    hashval = ((hashval << 5) + hashval) + *string++;
  return hashval;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1144 <hash+0x44>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 33
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add i32 %9, %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
void test11_HelloWorld_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test11_HelloWorld_targetInit__I() {
ret void
}
/* Type definitions */
struct goat3d_mesh {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gen_torus_part(struct goat3d_mesh *, float, float, int, int,
                                  double, double, double);
void gen_torus(struct goat3d_mesh *mesh, float inner, float outer, int usub,
               int vsub) {
  gen_torus_part(mesh, inner, outer, usub, vsub, 1.0, 0.0, 1.0);
}


x86 assembly (clang, -O0):
<gen_torus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movsd  0xeb8(%rip),%xmm4
xorps  %xmm3,%xmm3
movaps %xmm4,%xmm2
call   1030 <gen_torus_part@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_torus>:
movsd  0xee8(%rip),%xmm2
xorps  %xmm3,%xmm3
movaps %xmm2,%xmm4
jmp    1030 <gen_torus_part@plt>

LLVM IR (-O0):
%struct.goat3d_mesh = type { i32 }
define void @gen_torus(%struct.goat3d_mesh* %0, float %1, float %2, i32 %3, i32 %4) {
%6 = alloca %struct.goat3d_mesh*
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
store %struct.goat3d_mesh* %0, %struct.goat3d_mesh** %6
store float %1, float* %7
store float %2, float* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.goat3d_mesh*, %struct.goat3d_mesh** %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @gen_torus_part(%struct.goat3d_mesh* %11, float %12, float %13, i32 %14, i32 %15, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
%struct.goat3d_mesh = type { i32 }
define void @gen_torus(%struct.goat3d_mesh* %0, float %1, float %2, i32 %3, i32 %4) {
%6 = tail call i32 @gen_torus_part(%struct.goat3d_mesh* %0, float %1, float %2, i32 %3, i32 %4, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00)
ret void
}
void kasan_check_write(const void *p, unsigned int size) {}


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

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

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

LLVM IR (-O2):
define void @kasan_check_write(i8* nocapture %0, i32 %1) {
ret void
}
void prefetch1(volatile void *p) {
  asm volatile("prefetcht1 %[p]" : [p] "+m"(*(volatile char *)p));
}


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

x86 assembly (clang, -O2):
<prefetch1>:
prefetcht1 (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetch1(i8* %0) {
tail call void asm sideeffect "prefetcht1 $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
/* Type definitions */
struct Event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
struct Event *remove_a_event_of_type(int type) {
  fprintf(stderr, "TO IMPLEMENT\n");
  return NULL;
}


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

x86 assembly (clang, -O2):
<remove_a_event_of_type>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Event = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"TO IMPLEMENT\0A\00"
define %struct.Event* @remove_a_event_of_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.Event* null
}

LLVM IR (-O2):
%struct.Event = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"TO IMPLEMENT\0A\00"
define noalias %struct.Event* @remove_a_event_of_type(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.Event* null
}
/* Variables and functions */
int /*<<< orphan*/ dump_info(unsigned int *, int, char *);
void undefined_instruction_handler(unsigned int *context) {
  dump_info(context, 4, "Undefined Instruction");
}


x86 assembly (clang, -O0):
<undefined_instruction_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
lea    0xed4(%rip),%rdx
call   1030 <dump_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<undefined_instruction_handler>:
lea    0xee9(%rip),%rdx
mov    $0x4,%esi
jmp    1030 <dump_info@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Undefined Instruction\00"
define void @undefined_instruction_handler(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @dump_info(i32* %3, i32 4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Undefined Instruction\00"
define void @undefined_instruction_handler(i32* %0) {
%2 = tail call i32 @dump_info(i32* %0, i32 4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addWaiting(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void sesc_wait(void) { addWaiting(pthread_self()); }


x86 assembly (clang, -O0):
<sesc_wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%edi
call   1030 <addWaiting@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sesc_wait>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <addWaiting@plt>

LLVM IR (-O0):
define void @sesc_wait() {
%1 = call i32 (...) @pthread_self()
%2 = call i32 @addWaiting(i32 %1)
ret void
}

LLVM IR (-O2):
define void @sesc_wait() {
%1 = tail call i32 (...) @pthread_self()
%2 = tail call i32 @addWaiting(i32 %1)
ret void
}
void Swap(char *a, char *b) {
  char t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @Swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
void PR64765(float *f, double *r) {
  int i;
#pragma acc kernels loop create(f) copy(r)
  for (i = 64; i < 76; i += 5) {
  }
}


x86 assembly (clang, -O0):
<PR64765>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x40,-0x14(%rbp)
cmpl   $0x4c,-0x14(%rbp)
jge    1130 <PR64765+0x30>
jmp    1122 <PR64765+0x22>
mov    -0x14(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <PR64765+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PR64765(float* %0, double* %1) {
%3 = alloca float*
%4 = alloca double*
%5 = alloca i32
store float* %0, float** %3
store double* %1, double** %4
store i32 64, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 76
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 5
store i32 %12, i32* %5
br label %6
13: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @PR64765(float* nocapture %0, double* nocapture %1) {
ret void
}