xunge/DecIR huggingface dataset:
void build_backup_name(buffer, original) char *buffer;
char *original;
{
  strcpy(buffer, original);
  modify_filename_extention(buffer, ".bak");
}


x86 assembly (clang, -O0):
<build_backup_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <modify_filename_extention@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_backup_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <modify_filename_extention@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".bak\00"
define void @build_backup_name(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 i8* @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @modify_filename_extention to i32 (i8*, i8*, ...)*)(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".bak\00"
define void @build_backup_name(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @modify_filename_extention to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int /*<<< orphan*/, int *, int,
                              int /*<<< orphan*/);
pid_t waitpid(pid_t pid, int *status, int options) {
  return syscall_cp(114, pid, status, options, 0);
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x72,%edi
xor    %r8d,%r8d
call   1030 <syscall_cp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x72,%edi
xor    %r8d,%r8d
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
define i32 @waitpid(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 = load i32, i32* %6
%10 = call i32 @syscall_cp(i32 114, i32 %7, i32* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @syscall_cp(i32 114, i32 %0, i32* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void fifi(void) {
  printf("FIFI !\n");
  getchar();
}


x86 assembly (clang, -O0):
<fifi>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifi>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
@str = [7 x i8] c"FIFI !\00"
define void @fifi() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
int test_imm_18int8_reg(signed char val) {
  return ((val) & (-0x18 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_18int8_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, -24
%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_18int8_reg(i8 signext %0) {
%2 = and i8 %0, -24
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ read_word_data(int /*<<< orphan*/, int);
uint16_t get_bus_pullups(uint8_t address) {
  return read_word_data(address, 0x0C);
}


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

x86 assembly (clang, -O2):
<get_bus_pullups>:
mov    $0xc,%esi
jmp    1030 <read_word_data@plt>

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

LLVM IR (-O2):
define i32 @get_bus_pullups(i32 %0) {
%2 = tail call i32 @read_word_data(i32 %0, i32 12)
ret i32 %2
}
double square(double x) { return ((x) * (x)); }


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

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

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

LLVM IR (-O2):
define double @square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *, int, char *);
void pstring_green(char *s) {
  printf("%c%s%s%c%s", 0x1B, "[1;32m", s, 0x1B, "[0m");
}


x86 assembly (clang, -O0):
<pstring_green>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
mov    $0x1b,%r8d
lea    0xed7(%rip),%rdx
lea    0xed7(%rip),%r9
mov    %r8d,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstring_green>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xeea(%rip),%rdx
lea    0xeea(%rip),%r9
mov    $0x1b,%esi
mov    $0x1b,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%c%s%s%c%s\00"
@.str.1 = [7 x i8] c"[1;32m\00"
@.str.2 = [4 x i8] c"[0m\00"
define void @pstring_green(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%c%s%s%c%s\00"
@.str.1 = [7 x i8] c"[1;32m\00"
@.str.2 = [4 x i8] c"[0m\00"
define void @pstring_green(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ReadUint32Le(void const *, int /*<<< orphan*/ *);
int32_t ReadInt32Le(const void *in, int32_t *value) {
  return ReadUint32Le(in, (uint32_t *)value);
}


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

x86 assembly (clang, -O2):
<ReadInt32Le>:
jmp    1030 <ReadUint32Le@plt>

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

LLVM IR (-O2):
define i32 @ReadInt32Le(i8* %0, i32* %1) {
%3 = tail call i32 @ReadUint32Le(i8* %0, i32* %1)
ret i32 %3
}
double logistic(double r, double x) { return r * x * (1 - x); }


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

x86 assembly (clang, -O2):
<logistic>:
mulsd  %xmm1,%xmm0
movsd  0xef4(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @logistic(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = fmul double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @logistic(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fsub double 1.000000e+00, %1
%5 = fmul double %3, %4
ret double %5
}
float sqr(float num) { return (num * num); }


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

x86 assembly (clang, -O2):
<sqr>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @sqr(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int bell_pitch;
};
typedef TYPE_1__ XKeyboardState;

/* Variables and functions */
void set_XKeyboardState_bell_pitch(void *_p, unsigned _v) {
  ((XKeyboardState *)_p)->bell_pitch = (unsigned)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyboardState_bell_pitch>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyboardState_bell_pitch(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyboardState_bell_pitch(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *ft_range(int min, int max) {
  int *out;
  int i;
  if (max <= min)
    return (NULL);
  (int *)malloc(sizeof(int) * (max - min));
  i = -1;
  while (++i < (max - min))
    out[i] = i + min;
  return (out);
}


x86 assembly (clang, -O0):
<ft_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1137 <ft_range+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1186 <ft_range+0x76>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    117e <ft_range+0x6e>
mov    -0x1c(%rbp),%edx
add    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1151 <ft_range+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_range>:
sub    %edi,%esi
jle    1123 <ft_range+0x13>
push   %rax
shl    $0x2,%esi
mov    %esi,%edi
call   1030 <malloc@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @ft_range(i32 %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32* null, i32** %3
br label %38
12: ; preds = %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = mul i64 4, %16
%18 = trunc i64 %17 to i32
%19 = call i64 @malloc(i32 %18)
%20 = inttoptr i64 %19 to i32*
store i32 -1, i32* %7
br label %21
21: ; preds = %28, %12
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = sub nsw i32 %24, %25
%27 = icmp slt i32 %23, %26
br i1 %27, label %28, label %36
28: ; preds = %21
%29 = load i32, i32* %7
%30 = load i32, i32* %4
%31 = add nsw i32 %29, %30
%32 = load i32*, i32** %6
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
store i32 %31, i32* %35
br label %21
36: ; preds = %21
%37 = load i32*, i32** %6
store i32* %37, i32** %3
br label %38
38: ; preds = %36, %11
%39 = load i32*, i32** %3
ret i32* %39
}

LLVM IR (-O2):
define noalias i32* @ft_range(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = sub nsw i32 %1, %0
%6 = shl i32 %5, 2
%7 = tail call i64 @malloc(i32 %6)
%8 = icmp slt i32 %5, 1
tail call void @llvm.assume(i1 %8)
br label %9
9: ; preds = %2, %4
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cleanLine(void) {
  printf(
      " |                                                                      "
      "                                                             | \r");
}


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

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

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

LLVM IR (-O2):
@.str = [137 x i8] c" | | \0D\00"
define void @cleanLine() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int sum = 0;
  int number;
  for (number = 2; number <= 100; number += 2) {
    sum += number;
  }
  printf("Sum is %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Sum is %d\0A\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 2, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2550)
ret i32 0
}
int prec(char operator) {
  switch (operator) {
  case '^':
    return 3;
  case '*':
    return 2;
  case '/':
    return 2;
  case '+':
    return 1;
  case '-':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<prec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     116f <prec+0x6f>
jmp    111f <prec+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1187 <prec+0x87>
jmp    1130 <prec+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1193 <prec+0x93>
jmp    1141 <prec+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     117b <prec+0x7b>
jmp    1152 <prec+0x52>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    119f <prec+0x9f>
jmp    1163 <prec+0x63>
movl   $0x3,-0x4(%rbp)
jmp    11a6 <prec+0xa6>
movl   $0x2,-0x4(%rbp)
jmp    11a6 <prec+0xa6>
movl   $0x2,-0x4(%rbp)
jmp    11a6 <prec+0xa6>
movl   $0x1,-0x4(%rbp)
jmp    11a6 <prec+0xa6>
movl   $0x1,-0x4(%rbp)
jmp    11a6 <prec+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prec>:
lea    -0x2a(%rdi),%eax
cmp    $0x5,%eax
ja     1125 <prec+0x25>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%eax
jmp    112f <prec+0x2f>
mov    $0x2,%eax
ret
mov    $0x3,%eax
cmp    $0x5e,%edi
jne    1130 <prec+0x30>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @prec(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 94, label %6
i32 42, label %7
i32 47, label %8
i32 43, label %9
i32 45, label %10
]
6: ; preds = %1
store i32 3, i32* %2
br label %12
7: ; preds = %1
store i32 2, i32* %2
br label %12
8: ; preds = %1
store i32 2, i32* %2
br label %12
9: ; preds = %1
store i32 1, i32* %2
br label %12
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @prec(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 94, label %8
i32 42, label %3
i32 47, label %4
i32 43, label %5
i32 45, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 0, %7 ], [ 1, %6 ], [ 1, %5 ], [ 2, %4 ], [ 2, %3 ], [ 3, %1 ]
ret i32 %9
}
int check_prime(int num) {
  int i, d;
  d = 1;
  for (i = 2; i <= (num / 2); i++) {
    if (num % i == 0)
      d = 0;
    break;
  }
  if (num == 1)
    d = 0;
  return d;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     114f <check_prime+0x4f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    114a <check_prime+0x4a>
movl   $0x0,-0xc(%rbp)
jmp    114f <check_prime+0x4f>
cmpl   $0x1,-0x4(%rbp)
jne    1160 <check_prime+0x60>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
cmp    $0x4,%edi
setl   %al
mov    %edi,%ecx
or     %al,%cl
cmp    $0x1,%edi
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
%3 = and i32 %0, 1
%4 = icmp ne i32 %3, 0
%5 = or i1 %2, %4
%6 = icmp ne i32 %0, 1
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t get_timestamp_ms() {
  struct timeval now;
  gettimeofday(&now, NULL);
  uint64_t ts = now.tv_sec;
  return ts * 1000 + now.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<get_timestamp_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x3e8,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp_ms>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_timestamp_ms() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_timestamp_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int CHAR_BIT;
int my_ctz(unsigned x) {
  int i;
  for (i = 0; i < CHAR_BIT * sizeof(unsigned); i++)
    if (x & ((unsigned)1 << i))
      break;
  return i;
}


x86 assembly (clang, -O0):
<my_ctz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    0x2ec7(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
cmp    %rcx,%rax
jae    115b <my_ctz+0x5b>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1148 <my_ctz+0x48>
jmp    115b <my_ctz+0x5b>
jmp    114d <my_ctz+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <my_ctz+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ctz>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rcx
test   %rcx,%rcx
je     113f <my_ctz+0x3f>
shl    $0x2,%rcx
cmp    $0x2,%rcx
mov    $0x1,%eax
cmovae %rcx,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %ecx,%edi
jb     1142 <my_ctz+0x42>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1130 <my_ctz+0x30>
ret
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @my_ctz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i32, i32* @CHAR_BIT
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = icmp ult i64 %6, %9
br i1 %10, label %11, label %22
11: ; preds = %4
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = shl i32 1, %13
%15 = and i32 %12, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %11
br label %22
18: ; preds = %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %17, %4
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @my_ctz(i32 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = icmp eq i32 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl nsw i64 %5, 2
%7 = call i64 @llvm.umax.i64(i64 %6, i64 1)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %4, %15
%10 = phi i64 [ 0, %4 ], [ %16, %15 ]
%11 = trunc i64 %10 to i32
%12 = shl nuw i32 1, %11
%13 = and i32 %12, %0
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = add nuw i64 %10, 1
%17 = icmp eq i64 %16, %7
br i1 %17, label %20, label %9
18: ; preds = %9
%19 = trunc i64 %10 to i32
br label %20
20: ; preds = %15, %18, %1
%21 = phi i32 [ 0, %1 ], [ %19, %18 ], [ %8, %15 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ dump();
int /*<<< orphan*/ init();
int /*<<< orphan*/ insertHead(int);
int /*<<< orphan*/ insertTail(int);
int main(void) {
  init();
  insertHead(1);
  insertHead(2);
  insertHead(3);
  insertHead(4);
  insertHead(5);
  insertTail(1);
  insertTail(2);
  insertTail(3);
  insertTail(4);
  insertTail(5);
  dump();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x1,%edi
call   1050 <insertHead@plt>
mov    $0x2,%edi
call   1050 <insertHead@plt>
mov    $0x3,%edi
call   1050 <insertHead@plt>
mov    $0x4,%edi
call   1050 <insertHead@plt>
mov    $0x5,%edi
call   1050 <insertHead@plt>
mov    $0x1,%edi
call   1030 <insertTail@plt>
mov    $0x2,%edi
call   1030 <insertTail@plt>
mov    $0x3,%edi
call   1030 <insertTail@plt>
mov    $0x4,%edi
call   1030 <insertTail@plt>
mov    $0x5,%edi
call   1030 <insertTail@plt>
mov    $0x0,%al
call   1040 <dump@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
mov    $0x1,%edi
call   1050 <insertHead@plt>
mov    $0x2,%edi
call   1050 <insertHead@plt>
mov    $0x3,%edi
call   1050 <insertHead@plt>
mov    $0x4,%edi
call   1050 <insertHead@plt>
mov    $0x5,%edi
call   1050 <insertHead@plt>
mov    $0x1,%edi
call   1030 <insertTail@plt>
mov    $0x2,%edi
call   1030 <insertTail@plt>
mov    $0x3,%edi
call   1030 <insertTail@plt>
mov    $0x4,%edi
call   1030 <insertTail@plt>
mov    $0x5,%edi
call   1030 <insertTail@plt>
xor    %eax,%eax
call   1040 <dump@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 @insertHead(i32 1)
%4 = call i32 @insertHead(i32 2)
%5 = call i32 @insertHead(i32 3)
%6 = call i32 @insertHead(i32 4)
%7 = call i32 @insertHead(i32 5)
%8 = call i32 @insertTail(i32 1)
%9 = call i32 @insertTail(i32 2)
%10 = call i32 @insertTail(i32 3)
%11 = call i32 @insertTail(i32 4)
%12 = call i32 @insertTail(i32 5)
%13 = call i32 (...) @dump()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 @insertHead(i32 1)
%3 = tail call i32 @insertHead(i32 2)
%4 = tail call i32 @insertHead(i32 3)
%5 = tail call i32 @insertHead(i32 4)
%6 = tail call i32 @insertHead(i32 5)
%7 = tail call i32 @insertTail(i32 1)
%8 = tail call i32 @insertTail(i32 2)
%9 = tail call i32 @insertTail(i32 3)
%10 = tail call i32 @insertTail(i32 4)
%11 = tail call i32 @insertTail(i32 5)
%12 = tail call i32 (...) @dump()
ret i32 0
}
int main(int argc, char *argv[]) { return (0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int noop(void) { return (-1); }


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

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

LLVM IR (-O0):
define i32 @noop() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @noop() {
ret i32 -1
}
int main(void) {
  int x = 0;
  x;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ testEmptyLinkedList();
int /*<<< orphan*/ testOperations();
int /*<<< orphan*/ testQSort();
int /*<<< orphan*/ testUniq();
int main() {
  testOperations();
  testQSort();
  testEmptyLinkedList();
  testUniq();
  puts("All tests was successfully passed");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <testOperations@plt>
mov    $0x0,%al
call   1070 <testQSort@plt>
mov    $0x0,%al
call   1060 <testEmptyLinkedList@plt>
mov    $0x0,%al
call   1040 <testUniq@plt>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <testOperations@plt>
xor    %eax,%eax
call   1070 <testQSort@plt>
xor    %eax,%eax
call   1060 <testEmptyLinkedList@plt>
xor    %eax,%eax
call   1040 <testUniq@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"All tests was successfully passed\00"
define i32 @main() {
%1 = call i32 (...) @testOperations()
%2 = call i32 (...) @testQSort()
%3 = call i32 (...) @testEmptyLinkedList()
%4 = call i32 (...) @testUniq()
%5 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"All tests was successfully passed\00"
define i32 @main() {
%1 = tail call i32 (...) @testOperations()
%2 = tail call i32 (...) @testQSort()
%3 = tail call i32 (...) @testEmptyLinkedList()
%4 = tail call i32 (...) @testUniq()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
int dev_read(void *, int, int);
int dev_read_block(void *buf, __u64 blk_addr) {
  return dev_read(buf, blk_addr * 4096, 4096);
}


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

x86 assembly (clang, -O2):
<dev_read_block>:
shl    $0xc,%esi
mov    $0x1000,%edx
jmp    1030 <dev_read@plt>

LLVM IR (-O0):
define i32 @dev_read_block(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 = mul nsw i32 %6, 4096
%8 = call i32 @dev_read(i8* %5, i32 %7, i32 4096)
ret i32 %8
}

LLVM IR (-O2):
define i32 @dev_read_block(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 12
%4 = tail call i32 @dev_read(i8* %0, i32 %3, i32 4096)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ printf(char *);
void foo(long *x) {
  (void)x;
  printf("foo\n");
  bar();
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <bar@plt>

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

LLVM IR (-O2):
@str = [4 x i8] c"foo\00"
define void @foo(i64* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @bar()
ret void
}
void cx11646_setAutobright(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @cx11646_setAutobright(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
double __ocml_len4_f64(double, double, double, double);
double norm4d(double x, double y, double z, double w) {
  return __ocml_len4_f64(x, y, z, w);
}


x86 assembly (clang, -O0):
<norm4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <__ocml_len4_f64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm4d>:
jmp    1030 <__ocml_len4_f64@plt>

LLVM IR (-O0):
define double @norm4d(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @__ocml_len4_f64(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @norm4d(double %0, double %1, double %2, double %3) {
%5 = tail call double @__ocml_len4_f64(double %0, double %1, double %2, double %3)
ret double %5
}
IR0IR1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*p0) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
mov    -0x20(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1141 <IR0IR1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <IR0IR1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0IR1>:
movzwl (%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = load i16*, i16** %13
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = icmp sle i32 %18, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = icmp ule i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
scalar_t__ lw_sock_send_str(int *, char *);
scalar_t__ recv_ok(int *);
int lw_protocol_do_ping(int *sock) {
  int result = 0;
  if (*sock >= 0 && lw_sock_send_str(sock, "PING")) {
    if (recv_ok(sock)) {
      result = 1;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<lw_protocol_do_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1179 <lw_protocol_do_ping+0x59>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <lw_sock_send_str@plt>
cmp    $0x0,%rax
je     1179 <lw_protocol_do_ping+0x59>
mov    -0x8(%rbp),%rdi
call   1030 <recv_ok@plt>
cmp    $0x0,%rax
je     1174 <lw_protocol_do_ping+0x54>
movl   $0x1,-0xc(%rbp)
jmp    1179 <lw_protocol_do_ping+0x59>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_protocol_do_ping>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
cmpl   $0x0,(%rdi)
js     114f <lw_protocol_do_ping+0x2f>
mov    %rdi,%rbx
lea    0xecc(%rip),%rsi
call   1040 <lw_sock_send_str@plt>
test   %rax,%rax
je     114f <lw_protocol_do_ping+0x2f>
mov    %rbx,%rdi
call   1030 <recv_ok@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PING\00"
define i32 @lw_protocol_do_ping(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = call i64 @lw_sock_send_str(i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32*, i32** %2
%13 = call i64 @recv_ok(i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %3
br label %16
16: ; preds = %15, %11
br label %17
17: ; preds = %16, %7, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"PING\00"
define i32 @lw_protocol_do_ping(i32* %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @lw_sock_send_str(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i64 @recv_ok(i32* %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ c_plsdev(char const *);
int opt_dev(const char *opt, const char *myoptarg, void *client_data) {
  (void)opt;
  (void)client_data;
  c_plsdev(myoptarg);
  return 0;
}


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

x86 assembly (clang, -O2):
<opt_dev>:
push   %rax
mov    %rsi,%rdi
call   1030 <c_plsdev@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opt_dev(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @c_plsdev(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __byte_swap_slow(void *, int);
void custom_hton(void *x, int size) {
  static int _test_big_endian = 42;
  static int _is_big_endian = -1;
  switch (_is_big_endian) {
  case 0:
    __byte_swap_slow(x, size);
    break;
  case 1:
    break;
  default:
    if (*(char *)&_test_big_endian == 42) {
      _is_big_endian = 0;
      __byte_swap_slow(x, size);
    } else
      _is_big_endian = 1;
  }
}


x86 assembly (clang, -O0):
<custom_hton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2f07(%rip),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1146 <custom_hton+0x36>
jmp    1135 <custom_hton+0x25>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1157 <custom_hton+0x47>
jmp    115c <custom_hton+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <__byte_swap_slow@plt>
jmp    1196 <custom_hton+0x86>
jmp    1196 <custom_hton+0x86>
movsbl 0x2ec5(%rip),%eax
cmp    $0x2a,%eax
jne    1187 <custom_hton+0x77>
movl   $0x0,0x2eb6(%rip)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <__byte_swap_slow@plt>
jmp    1191 <custom_hton+0x81>
movl   $0x1,0x2e9b(%rip)
jmp    1196 <custom_hton+0x86>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_hton>:
cmpb   $0x0,0x2f15(%rip)
jne    1120 <custom_hton+0x10>
movb   $0x1,0x2f0c(%rip)
jmp    1030 <__byte_swap_slow@plt>

LLVM IR (-O0):
@custom_hton._test_big_endian = internal global i32 42
@custom_hton._is_big_endian = internal global i32 -1
define void @custom_hton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @custom_hton._is_big_endian
switch i32 %5, label %11 [
i32 0, label %6
i32 1, label %10
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @__byte_swap_slow(i8* %7, i32 %8)
br label %21
10: ; preds = %2
br label %21
11: ; preds = %2
%12 = load i8, i8* bitcast (i32* @custom_hton._test_big_endian to i8*)
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 42
br i1 %14, label %15, label %19
15: ; preds = %11
store i32 0, i32* @custom_hton._is_big_endian
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = call i32 @__byte_swap_slow(i8* %16, i32 %17)
br label %20
19: ; preds = %11
store i32 1, i32* @custom_hton._is_big_endian
br label %20
20: ; preds = %19, %15
br label %21
21: ; preds = %20, %10, %6
ret void
}

LLVM IR (-O2):
@custom_hton._is_big_endian = internal unnamed_addr global i1 false
define void @custom_hton(i8* %0, i32 %1) {
%3 = load i1, i1* @custom_hton._is_big_endian
br i1 %3, label %5, label %4
4: ; preds = %2
store i1 true, i1* @custom_hton._is_big_endian
br label %5
5: ; preds = %2, %4
%6 = tail call i32 @__byte_swap_slow(i8* %0, i32 %1)
ret void
}
void _src_iter_inc_line(unsigned *line, unsigned *back_column,
                        const char *current) {
  (*line)++;
  *back_column =
      (unsigned)((unsigned long long)(current - (const char *)0) & ~0u);
}


x86 assembly (clang, -O0):
<_src_iter_inc_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
sub    $0x0,%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_src_iter_inc_line>:
addl   $0x1,(%rdi)
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define void @_src_iter_inc_line(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add i32 %8, 1
store i32 %9, i32* %7
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = sub i64 %11, 0
%13 = and i64 %12, 4294967295
%14 = trunc i64 %13 to i32
%15 = load i32*, i32** %5
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @_src_iter_inc_line(i32* nocapture %0, i32* nocapture writeonly %1, i8* %2) {
%4 = load i32, i32* %0
%5 = add i32 %4, 1
store i32 %5, i32* %0
%6 = ptrtoint i8* %2 to i64
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
ret void
}
unsigned char unsignedchar_ignoring_signedshortint(unsigned char x,
                                                   signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @unsignedchar_ignoring_signedshortint(i8 zeroext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_signedshortint(i8 returned zeroext %0, i16 signext %1) {
ret i8 %0
}
void genc_lt_d() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct rblists *);
void rb_closelist(struct rblists *rblistp) {
  if (rblistp)
    free(rblistp);
}


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

x86 assembly (clang, -O2):
<rb_closelist>:
test   %rdi,%rdi
je     111a <rb_closelist+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.rblists = type { i32 }
define void @rb_closelist(%struct.rblists* %0) {
%2 = alloca %struct.rblists*
store %struct.rblists* %0, %struct.rblists** %2
%3 = load %struct.rblists*, %struct.rblists** %2
%4 = icmp ne %struct.rblists* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.rblists*, %struct.rblists** %2
%7 = call i32 @free(%struct.rblists* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.rblists = type { i32 }
define void @rb_closelist(%struct.rblists* %0) {
%2 = icmp eq %struct.rblists* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.rblists* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int __infer_nondet_int();
int pthread_mutex_destroy(pthread_mutex_t *mutex) {
  if (mutex == 0)
    while (1)
      ;
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<pthread_mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1131 <pthread_mutex_destroy+0x21>
jmp    112c <pthread_mutex_destroy+0x1c>
jmp    112c <pthread_mutex_destroy+0x1c>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_destroy>:
test   %rdi,%rdi
je     1120 <pthread_mutex_destroy+0x10>
xor    %eax,%eax
jmp    1030 <__infer_nondet_int@plt>
nopl   0x0(%rax)
jmp    1120 <pthread_mutex_destroy+0x10>

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

LLVM IR (-O2):
define i32 @pthread_mutex_destroy(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
%5 = tail call i32 (...) @__infer_nondet_int()
ret i32 %5
}