xunge/DecIR huggingface dataset:
void swap_by_ind(int i, int j, double *x) {
  double tmp;
  tmp = x[i];
  x[i] = x[j];
  x[j] = tmp;
}


x86 assembly (clang, -O0):
<swap_by_ind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_by_ind>:
movslq %edi,%rax
movsd  (%rdx,%rax,8),%xmm0
movslq %esi,%rcx
movsd  (%rdx,%rcx,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
movsd  %xmm0,(%rdx,%rcx,8)
ret

LLVM IR (-O0):
define void @swap_by_ind(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load double*, double** %6
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %8, i64 %10
%12 = load double, double* %11
store double %12, double* %7
%13 = load double*, double** %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
%17 = load double, double* %16
%18 = load double*, double** %6
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
store double %17, double* %21
%22 = load double, double* %7
%23 = load double*, double** %6
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
ret void
}

LLVM IR (-O2):
define void @swap_by_ind(i32 %0, i32 %1, double* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds double, double* %2, i64 %4
%6 = load double, double* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = load double, double* %8
store double %9, double* %5
store double %6, double* %8
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *my_strndup(const char *s, size_t nchars) {
  char *r = malloc(sizeof(char) * (nchars + 1));
  if (r) {
    memcpy(r, s, nchars);
    r[nchars] = 0;
  }
  return r;
}


x86 assembly (clang, -O0):
<my_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116f <my_strndup+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114e <my_strndup+0x2e>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @my_strndup(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
unsigned long AlignAddr(unsigned long Addr, unsigned long Alignment) {
  return ((Addr + Alignment - 1) / Alignment) * Alignment;
}


x86 assembly (clang, -O0):
<AlignAddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
imul   -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AlignAddr>:
lea    (%rdi,%rsi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111e <AlignAddr+0x1e>
mov    %rcx,%rax
xor    %edx,%edx
div    %rsi
jmp    1124 <AlignAddr+0x24>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @AlignAddr(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = udiv i64 %8, %9
%11 = load i64, i64* %4
%12 = mul i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @AlignAddr(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = urem i64 %4, %1
%6 = sub i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void postLabel(char *theLabel, char *comment) {
  printf("%s:\t%s\n", theLabel, comment);
}


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

x86 assembly (clang, -O2):
<postLabel>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s:\09%s\0A\00"
define void @postLabel(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 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s:\09%s\0A\00"
define void @postLabel(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
signed int rt_mutex_init(union anon$40 *mp) {
  signed int status = 0;
  status = pthread_mutex_init(mp, ((const union anon$43 *)((void *)0)));
  return status;
}


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

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

LLVM IR (-O0):
%"union.anon$40" = type opaque
%"union.anon$43" = type opaque
define i32 @rt_mutex_init(%"union.anon$40"* %0) {
%2 = alloca %"union.anon$40"*
%3 = alloca i32
store %"union.anon$40"* %0, %"union.anon$40"** %2
store i32 0, i32* %3
%4 = load %"union.anon$40"*, %"union.anon$40"** %2
%5 = call i32 (%"union.anon$40"*, %"union.anon$43"*, ...) bitcast (i32 (...)* @pthread_mutex_init to i32 (%"union.anon$40"*, %"union.anon$43"*, ...)*)(%"union.anon$40"* %4, %"union.anon$43"* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%"union.anon$40" = type opaque
%"union.anon$43" = type opaque
define i32 @rt_mutex_init(%"union.anon$40"* %0) {
%2 = tail call i32 (%"union.anon$40"*, %"union.anon$43"*, ...) bitcast (i32 (...)* @pthread_mutex_init to i32 (%"union.anon$40"*, %"union.anon$43"*, ...)*)(%"union.anon$40"* %0, %"union.anon$43"* null)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _test_1(int *);
void soru_1() {
  int dizi[100];
  _test_1(dizi);
}


x86 assembly (clang, -O0):
<soru_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rdi
call   1030 <_test_1@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_1>:
sub    $0x198,%rsp
mov    %rsp,%rdi
call   1030 <_test_1@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define void @soru_1() {
%1 = alloca [100 x i32]
%2 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%3 = call i32 @_test_1(i32* %2)
ret void
}

LLVM IR (-O2):
define void @soru_1() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @_test_1(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Niall_NewDictionary();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void Niall_Init(void) {
  srand(time(NULL));
  Niall_NewDictionary();
}


x86 assembly (clang, -O0):
<Niall_Init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <Niall_NewDictionary@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Niall_Init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <Niall_NewDictionary@plt>

LLVM IR (-O0):
define void @Niall_Init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @Niall_NewDictionary()
ret void
}

LLVM IR (-O2):
define void @Niall_Init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @Niall_NewDictionary()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int bor_read_str(int, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int dialog(int soc) {
  char buffer[2048];
  int result = bor_read_str(soc, buffer, sizeof(buffer));
  if (result < 0)
    perror("Erreur a la lecture\n");
  else
    printf("Lecture : %s\n", buffer);
  return result;
}


x86 assembly (clang, -O0):
<dialog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    $0x800,%edx
call   1040 <bor_read_str@plt>
mov    %eax,-0x814(%rbp)
cmpl   $0x0,-0x814(%rbp)
jge    1176 <dialog+0x46>
lea    0xe94(%rip),%rdi
call   1050 <perror@plt>
jmp    1189 <dialog+0x59>
lea    -0x810(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x814(%rbp),%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dialog>:
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rsi
mov    $0x800,%edx
call   1040 <bor_read_str@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1165 <dialog+0x35>
lea    0xec3(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x800,%rsp
pop    %rbx
ret
lea    0xe94(%rip),%rdi
call   1050 <perror@plt>
jmp    115a <dialog+0x2a>

LLVM IR (-O0):
@.str = [21 x i8] c"Erreur a la lecture\0A\00"
@.str.1 = [14 x i8] c"Lecture : %s\0A\00"
define i32 @dialog(i32 %0) {
%2 = alloca i32
%3 = alloca [2048 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%7 = call i32 @bor_read_str(i32 %5, i8* %6, i32 2048)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %15
12: ; preds = %1
%13 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %10
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@.str = [21 x i8] c"Erreur a la lecture\0A\00"
@.str.1 = [14 x i8] c"Lecture : %s\0A\00"
define i32 @dialog(i32 %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @bor_read_str(i32 %0, i8* %3, i32 2048)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %10
10: ; preds = %8, %6
ret i32 %4
}
int adis16300_configure_ring(struct iio_dev *indio_dev) { 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.iio_dev = type opaque
define i32 @adis16300_configure_ring(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @adis16300_configure_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct sockaddr_ll {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ from;

/* Variables and functions */
int recvfrom(int, char *, int, int, struct sockaddr *, int *);
int readCap(int fd, char *pBuf, int size) {
  struct sockaddr_ll from;
  int fromlen = sizeof(from);
  return recvfrom(fd, pBuf, size, 0x20, (struct sockaddr *)&from, &fromlen);
}


x86 assembly (clang, -O0):
<readCap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%r8
mov    $0x20,%ecx
lea    -0x1c(%rbp),%r9
call   1030 <recvfrom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readCap>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
mov    $0x20,%ecx
call   1030 <recvfrom@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_ll = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @readCap(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.sockaddr_ll
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 4, i32* %8
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = bitcast %struct.sockaddr_ll* %7 to %struct.sockaddr*
%13 = call i32 @recvfrom(i32 %9, i8* %10, i32 %11, i32 32, %struct.sockaddr* %12, i32* %8)
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr_ll = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @readCap(i32 %0, i8* %1, i32 %2) {
%4 = alloca %struct.sockaddr_ll
%5 = alloca i32
%6 = bitcast %struct.sockaddr_ll* %4 to i8*
%7 = bitcast i32* %5 to i8*
store i32 4, i32* %5
%8 = bitcast %struct.sockaddr_ll* %4 to %struct.sockaddr*
%9 = call i32 @recvfrom(i32 %0, i8* %1, i32 %2, i32 32, %struct.sockaddr* %8, i32* %5)
ret i32 %9
}
/* Variables and functions */
double abs(double x) {
  if (x < 0) {
    return -x;
  }
  return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <abs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <abs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t _ROR32(uint32_t val, int amount) {
  uint32_t shift_out = val << (32 - amount);
  return val >> amount | shift_out;
}


x86 assembly (clang, -O0):
<_ROR32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ROR32>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_ROR32(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* %4
%8 = sub nsw i32 32, %7
%9 = shl i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = ashr i32 %10, %11
%13 = load i32, i32* %5
%14 = or i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @_ROR32(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %0, %1
%6 = or i32 %4, %5
ret i32 %6
}
void set_led_1(int mode) {
  if (mode == 1) {
    (*(volatile unsigned int *)(0x7F008824)) |= 1;
  } else if (mode == 0) {
    (*(volatile unsigned int *)(0x7F008824)) &= ~1;
  }
  return;
}


x86 assembly (clang, -O0):
<set_led_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1127 <set_led_1+0x27>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    1147 <set_led_1+0x47>
cmpl   $0x0,-0x4(%rbp)
jne    1142 <set_led_1+0x42>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    1147 <set_led_1+0x47>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_led_1>:
test   %edi,%edi
je     1115 <set_led_1+0x15>
cmp    $0x1,%edi
jne    1126 <set_led_1+0x26>
mov    0x7f008824,%eax
or     $0x1,%eax
jmp    111f <set_led_1+0x1f>
mov    0x7f008824,%eax
and    $0xfffffffe,%eax
mov    %eax,0x7f008824
ret

LLVM IR (-O0):
define void @set_led_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%7 = or i32 %6, 1
store volatile i32 %7, i32* inttoptr (i64 2130741284 to i32*)
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%13 = and i32 %12, -2
store volatile i32 %13, i32* inttoptr (i64 2130741284 to i32*)
br label %14
14: ; preds = %11, %8
br label %15
15: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
define void @set_led_1(i32 %0) {
switch i32 %0, label %10 [
i32 1, label %2
i32 0, label %5
]
2: ; preds = %1
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = or i32 %3, 1
br label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%7 = and i32 %6, -2
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ %4, %2 ]
store volatile i32 %9, i32* inttoptr (i64 2130741284 to i32*)
br label %10
10: ; preds = %8, %1
ret void
}
char *MYstrcpy(char *destination, char *source) {
  for (; *destination++ = *source++;)
    ;
  return destination;
}


x86 assembly (clang, -O0):
<MYstrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <MYstrcpy+0x3b>
jmp    110c <MYstrcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MYstrcpy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <MYstrcpy+0x10>
ret

LLVM IR (-O0):
define i8* @MYstrcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %12, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = icmp ne i8 %8, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @MYstrcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %8
}
int free_memory() {
  extern int __heap_start, *__brkval;
  int v;
  return ((int)&v - (__brkval == 0 ? (int)&__heap_start : (int)__brkval));
}


x86 assembly (clang, -O0):
<free_memory>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    0x2ed6(%rip),%rax
cmpq   $0x0,(%rax)
jne    112b <free_memory+0x2b>
mov    0x2eb5(%rip),%rax
mov    %eax,-0xc(%rbp)
jmp    1138 <free_memory+0x38>
mov    0x2eb6(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_memory>:
lea    -0x4(%rsp),%rax
mov    0x2edc(%rip),%rcx
mov    (%rcx),%rcx
test   %rcx,%rcx
jne    111a <free_memory+0x1a>
mov    0x2ebe(%rip),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
@__brkval = external global i32*
@__heap_start = external global i32
define i32 @free_memory() {
%1 = alloca i32
%2 = ptrtoint i32* %1 to i32
%3 = load i32*, i32** @__brkval
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %9
6: ; preds = %0
%7 = load i32*, i32** @__brkval
%8 = ptrtoint i32* %7 to i32
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ ptrtoint (i32* @__heap_start to i32), %5 ], [ %8, %6 ]
%11 = sub nsw i32 %2, %10
ret i32 %11
}

LLVM IR (-O2):
@__brkval = external global i32*
@__heap_start = external global i32
define i32 @free_memory() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = load i32*, i32** @__brkval
%6 = icmp eq i32* %5, null
%7 = ptrtoint i32* %5 to i64
%8 = trunc i64 %7 to i32
%9 = select i1 %6, i32 ptrtoint (i32* @__heap_start to i32), i32 %8
%10 = sub nsw i32 %4, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
void strcpy_get_ext(char *d, char *s) {
  char *tmp = strrchr(s, '.');
  if (!tmp) {
    strcpy(d, "");
    return;
  } else {
    strcpy(d, tmp + 1);
  }
}


x86 assembly (clang, -O0):
<strcpy_get_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <strcpy_get_ext+0x42>
mov    -0x8(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1173 <strcpy_get_ext+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_get_ext>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1146 <strcpy_get_ext+0x26>
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @strcpy_get_ext(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** %4
%7 = call i8* @strrchr(i8* %6, i8 signext 46)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %18
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 @strcpy(i8* %14, i8* %16)
br label %18
18: ; preds = %10, %13
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @strcpy_get_ext(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @strcpy(i8* %0, i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int readBits(int /*<<< orphan*/ *, int);
int readSBits(FILE *f, int number) {
  int num = readBits(f, number);
  if (num & (1 << (number - 1)))
    return num - (1 << number);
  else
    return num;
}


x86 assembly (clang, -O0):
<readSBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <readBits@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1164 <readSBits+0x54>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <readSBits+0x5a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSBits>:
push   %rbx
mov    %esi,%ebx
call   1030 <readBits@plt>
lea    -0x1(%rbx),%ecx
movzbl %cl,%edx
mov    $0xffffffff,%esi
mov    %ebx,%ecx
shl    %cl,%esi
xor    %ecx,%ecx
bt     %edx,%eax
cmovb  %esi,%ecx
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readSBits(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* %5
%9 = call i32 @readBits(i32* %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = shl i32 1, %12
%14 = and i32 %10, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = shl i32 1, %18
%20 = sub nsw i32 %17, %19
store i32 %20, i32* %3
br label %23
21: ; preds = %2
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %16
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @readSBits(i32* %0, i32 %1) {
%3 = tail call i32 @readBits(i32* %0, i32 %1)
%4 = add nsw i32 %1, -1
%5 = shl nuw i32 1, %4
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = shl nsw i32 -1, %1
%9 = select i1 %7, i32 0, i32 %8
%10 = add i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ cli_loop();
int /*<<< orphan*/ get_cmd();
void loop() {
  get_cmd();
  cli_loop();
}


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

x86 assembly (clang, -O2):
<loop>:
push   %rax
xor    %eax,%eax
call   1040 <get_cmd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cli_loop@plt>

LLVM IR (-O0):
define void @loop() {
%1 = call i32 (...) @get_cmd()
%2 = call i32 (...) @cli_loop()
ret void
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 (...) @get_cmd()
%2 = tail call i32 (...) @cli_loop()
ret void
}
int suma(int dato, int dato2) {
  int salida;
  asm volatile("addl %%ebx, %%eax" : "=a"(salida) : "a"(dato), "b"(dato2));
  return salida;
}


x86 assembly (clang, -O0):
<suma>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
add    %ebx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<suma>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @suma(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* %4
%8 = call i32 asm sideeffect "addl %ebx, %eax", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = tail call i32 asm sideeffect "addl %ebx, %eax", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double next_fp(double);
double prev_fp(double x) { return (-next_fp(-x)); }


x86 assembly (clang, -O0):
<prev_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <next_fp@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prev_fp>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <next_fp@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @prev_fp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @next_fp(double %4)
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @prev_fp(double %0) {
%2 = fneg double %0
%3 = tail call double @next_fp(double %2)
%4 = fneg double %3
ret double %4
}
void U210ToAB30() {}


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

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

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

LLVM IR (-O2):
define void @U210ToAB30() {
ret void
}
void fp_force_evalf(float x) {
  volatile float y;
  y = x;
  (void)y;
}


x86 assembly (clang, -O0):
<fp_force_evalf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_force_evalf>:
movss  %xmm0,-0x4(%rsp)
movss  -0x4(%rsp),%xmm0
ret

LLVM IR (-O0):
define void @fp_force_evalf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
store volatile float %4, float* %3
%5 = load volatile float, float* %3
ret void
}

LLVM IR (-O2):
define void @fp_force_evalf(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
store volatile float %0, float* %2
%4 = load volatile float, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR8E_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR8E_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR8E_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
double pow(double, int);
double phi(double x, double kNa) {
  return pow(x, 3) / (pow(x, 3) + pow(kNa, 3));
}


x86 assembly (clang, -O0):
<phi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
addsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @phi(double %0, double %1) {
%3 = tail call double @pow(double %0, i32 3)
%4 = tail call double @pow(double %0, i32 3)
%5 = tail call double @pow(double %1, i32 3)
%6 = fadd double %4, %5
%7 = fdiv double %3, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  char *jetstring;
  jetstring = "/"
              "FA-18"
              " "
              "Hornet"
              "s and "
              "A-10"
              " "
              "Thunderbolt"
              "s";
  printf("%s\n", jetstring);
  printf("/");
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2f,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [37 x i8] c"/FA-18 Hornets and A-10 Thunderbolts\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 47)
%5 = tail call i32 @putchar(i32 10)
ret i32 0
}
void dev_pm_enable_wake_irq(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @dev_pm_enable_wake_irq(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
int strtol(char *, char **, int);
int parseInt(char **ptr) { return strtol(*ptr, ptr, 10); }


x86 assembly (clang, -O0):
<parseInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseInt>:
mov    %rdi,%rsi
mov    (%rdi),%rdi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @parseInt(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8**, i8*** %2
%6 = call i32 @strtol(i8* %4, i8** %5, i32 10)
ret i32 %6
}

LLVM IR (-O2):
define i32 @parseInt(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @strtol(i8* %2, i8** %0, i32 10)
ret i32 %3
}
int soundio_int_min(int a, int b) { return (a <= b) ? a : b; }


x86 assembly (clang, -O0):
<soundio_int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1121 <soundio_int_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <soundio_int_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soundio_int_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @soundio_int_min(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @soundio_int_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ltrim(char const *);
char *rtrim(char *);
char *trim(const char *input) {
  char *ltrimmed = ltrim(input);
  char *rtrimmed = rtrim(ltrimmed);
  free(ltrimmed);
  return rtrimmed;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ltrim@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <rtrim@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %r14
push   %rbx
push   %rax
call   1050 <ltrim@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <rtrim@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @ltrim(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @rtrim(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i8* @ltrim(i8* %0)
%3 = tail call i8* @rtrim(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %3
}
/* Variables and functions */
scalar_t__ malloc(int);
char *makeEmptyBoard() { return (char *)malloc(64); }


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

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

LLVM IR (-O0):
define i8* @makeEmptyBoard() {
%1 = call i64 @malloc(i32 64)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @makeEmptyBoard() {
%1 = tail call i64 @malloc(i32 64)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ blah();
int main(int argc, char **argv) {
  blah();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @blah()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @blah()
ret i32 0
}
int _close(int file) {
  (void)file;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
int drm_vblank_init(struct drm_device *, int);
int mach64_driver_load(struct drm_device *dev, unsigned long flags) {
  return drm_vblank_init(dev, 1);
}


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

x86 assembly (clang, -O2):
<mach64_driver_load>:
mov    $0x1,%esi
jmp    1030 <drm_vblank_init@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define i32 @mach64_driver_load(%struct.drm_device* %0, i64 %1) {
%3 = alloca %struct.drm_device*
%4 = alloca i64
store %struct.drm_device* %0, %struct.drm_device** %3
store i64 %1, i64* %4
%5 = load %struct.drm_device*, %struct.drm_device** %3
%6 = call i32 @drm_vblank_init(%struct.drm_device* %5, i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define i32 @mach64_driver_load(%struct.drm_device* %0, i64 %1) {
%3 = tail call i32 @drm_vblank_init(%struct.drm_device* %0, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_ror_epi32(int /*<<< orphan*/, int);
__attribute__((always_)) __m256i rot16_256(__m256i x) {
  return _mm256_ror_epi32(x, 16);
}


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

x86 assembly (clang, -O2):
<rot16_256>:
mov    $0x10,%esi
jmp    1030 <_mm256_ror_epi32@plt>

LLVM IR (-O0):
define i32 @rot16_256(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm256_ror_epi32(i32 %3, i32 16)
ret i32 %4
}

LLVM IR (-O2):
define i32 @rot16_256(i32 %0) {
%2 = tail call i32 @_mm256_ror_epi32(i32 %0, i32 16)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, char const *, size_t);
int strlen(char const *);
void cb_get_kv(const void *kv, void *value, size_t len) {
  const char *key = (const char *)kv;
  size_t keylen = strlen(key) + 1;
  memmove(value, key + keylen, len);
}


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

x86 assembly (clang, -O2):
<cb_get_kv>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
lea    (%rax,%rbx,1),%rsi
add    $0x1,%rsi
mov    %r15,%rdi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define void @cb_get_kv(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = load i8*, i8** %7
%16 = load i64, i64* %8
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i64, i64* %6
%19 = call i32 @memmove(i8* %14, i8* %17, i64 %18)
ret void
}

LLVM IR (-O2):
define void @cb_get_kv(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @memmove(i8* %1, i8* %7, i64 %2)
ret void
}
void I422ToRGB565Row_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @I422ToRGB565Row_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void DEC_HOST_REG_W(int host_reg) {
  addbyte(0x66);
  addbyte(0x48 | host_reg);
}


x86 assembly (clang, -O0):
<DEC_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0x48,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEC_HOST_REG_W>:
push   %rbx
mov    %edi,%ebx
mov    $0x66,%edi
call   1030 <addbyte@plt>
or     $0x48,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @DEC_HOST_REG_W(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 102)
%4 = load i32, i32* %2
%5 = or i32 72, %4
%6 = call i32 @addbyte(i32 %5)
ret void
}

LLVM IR (-O2):
define void @DEC_HOST_REG_W(i32 %0) {
%2 = tail call i32 @addbyte(i32 102)
%3 = or i32 %0, 72
%4 = tail call i32 @addbyte(i32 %3)
ret void
}
int test_imm_01int8_reg(signed char val) {
  return ((val) & (0x01 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_01int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_01int8_reg>:
test   $0x1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_01int8_reg(i8 signext %0) {
%2 = and i8 %0, 1
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char __attribute__((visibility("default"))) func_b() {
  if ('c' != 'c') {
    exit(3);
  }
  return 'b';
}


x86 assembly (clang, -O0):
<func_b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_b>:
mov    $0x62,%al
ret

LLVM IR (-O0):
define signext i8 @func_b() {
ret i8 98
}

LLVM IR (-O2):
define signext i8 @func_b() {
ret i8 98
}