xunge/DecIR huggingface dataset:
void subvf(float *result, const float *s1, const float s2) {
  result[0] = s1[0] - s2;
  result[1] = s1[1] - s2;
  result[2] = s1[2] - s2;
}


x86 assembly (clang, -O0):
<subvf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
subss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
subss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
subss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<subvf>:
movss  (%rsi),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rsi),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @subvf(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fsub float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fsub float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fsub float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_pi16(short);
__m64 test_mm_set1_pi16(short a) { return _mm_set1_pi16(a); }


x86 assembly (clang, -O0):
<test_mm_set1_pi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <_mm_set1_pi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_set1_pi16>:
jmp    1030 <_mm_set1_pi16@plt>

LLVM IR (-O0):
define i32 @test_mm_set1_pi16(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @_mm_set1_pi16(i16 signext %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_mm_set1_pi16(i16 signext %0) {
%2 = tail call i32 @_mm_set1_pi16(i16 signext %0)
ret i32 %2
}
void HplAtm128Timer0AsyncP$Compare$fired(void) {
  Atm128AlarmAsyncP$0$Compare$fired();
}


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

x86 assembly (clang, -O2):
<HplAtm128Timer0AsyncP$Compare$fired>:
xor    %eax,%eax
jmp    1030 <Atm128AlarmAsyncP$0$Compare$fired@plt>

LLVM IR (-O0):
define void @"HplAtm128Timer0AsyncP$Compare$fired"() {
%1 = call i32 (...) @"Atm128AlarmAsyncP$0$Compare$fired"()
ret void
}

LLVM IR (-O2):
define void @"HplAtm128Timer0AsyncP$Compare$fired"() {
%1 = tail call i32 (...) @"Atm128AlarmAsyncP$0$Compare$fired"()
ret void
}
/* Type definitions */
struct aiocb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int aio_read(struct aiocb *cb) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<aio_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_read>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_read(%struct.aiocb* %0) {
%2 = alloca %struct.aiocb*
store %struct.aiocb* %0, %struct.aiocb** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_read(%struct.aiocb* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t time_us(void) {
  struct timeval tval;
  gettimeofday(&tval, NULL);
  return 1e6 * tval.tv_sec + tval.tv_usec;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @time_us() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double 1.000000e+06, double %5, double %8)
%10 = fptosi double %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @time_us() {
%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 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %9)
%11 = fptosi double %10 to i64
ret i64 %11
}
/* Variables and functions */
scalar_t__ malloc(int);
void *copy_int(int *num) {
  int *new_num;
  if ((new_num = (int *)malloc(sizeof(int))) == NULL)
    return NULL;
  *new_num = *num;
  return (void *)new_num;
}


x86 assembly (clang, -O0):
<copy_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1141 <copy_int+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1155 <copy_int+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_int>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1129 <copy_int+0x19>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @copy_int(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %4
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %15
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %4
%14 = bitcast i32* %13 to i8*
store i8* %14, i8** %2
br label %15
15: ; preds = %9, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @copy_int(i32* nocapture %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i32*
%6 = load i32, i32* %0
store i32 %6, i32* %5
%7 = inttoptr i64 %2 to i8*
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
char const *fill_str_len(char const *, size_t);
const char *fillstr(const char *fill, size_t len) {
  if (!fill || !*fill) {
    fill = "-";
  }
  return fill_str_len(fill, len);
}


x86 assembly (clang, -O0):
<fillstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <fillstr+0x28>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1143 <fillstr+0x33>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fill_str_len@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillstr>:
test   %rdi,%rdi
je     111f <fillstr+0xf>
cmpb   $0x0,(%rdi)
je     111f <fillstr+0xf>
jmp    1030 <fill_str_len@plt>
lea    0xeda(%rip),%rdi
jmp    1030 <fill_str_len@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define i8* @fillstr(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %2
br label %8
8: ; preds = %7, %4
%9 = phi i8* [ %0, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %7 ]
%10 = tail call i8* @fill_str_len(i8* %9, i64 %1)
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_ll_raw_data(void *data) {
  free(data);
  return;
}


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

x86 assembly (clang, -O2):
<free_ll_raw_data>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_ll_raw_data(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
struct pneigh_entry *pneigh_clone(struct pneigh_entry *pneigh) {
  return pneigh;
}


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

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

LLVM IR (-O0):
%struct.pneigh_entry = type opaque
define %struct.pneigh_entry* @pneigh_clone(%struct.pneigh_entry* %0) {
%2 = alloca %struct.pneigh_entry*
store %struct.pneigh_entry* %0, %struct.pneigh_entry** %2
%3 = load %struct.pneigh_entry*, %struct.pneigh_entry** %2
ret %struct.pneigh_entry* %3
}

LLVM IR (-O2):
%struct.pneigh_entry = type opaque
define %struct.pneigh_entry* @pneigh_clone(%struct.pneigh_entry* readnone returned %0) {
ret %struct.pneigh_entry* %0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t tea5767_mhz_to_regs(float mhz) {
  if ((mhz < 76.0f) || (mhz > 108.0f)) {
    return 0;
  }
  return 4 * (mhz * 1000000 + 225000) / 32768;
}


x86 assembly (clang, -O0):
<tea5767_mhz_to_regs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
ja     1131 <tea5767_mhz_to_regs+0x31>
movss  -0x8(%rbp),%xmm0
movss  0xedc(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    113d <tea5767_mhz_to_regs+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1179 <tea5767_mhz_to_regs+0x79>
movss  -0x8(%rbp),%xmm1
movss  0xec6(%rip),%xmm0
mulss  %xmm0,%xmm1
movss  0xebe(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xeaa(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  0xe9a(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tea5767_mhz_to_regs>:
xor    %eax,%eax
movss  0xef6(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     113c <tea5767_mhz_to_regs+0x3c>
ucomiss 0xeee(%rip),%xmm0
ja     113c <tea5767_mhz_to_regs+0x3c>
mulss  0xee8(%rip),%xmm0
addss  0xee4(%rip),%xmm0
mulss  0xee0(%rip),%xmm0
mulss  0xedc(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @tea5767_mhz_to_regs(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 7.600000e+01
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load float, float* %3
%8 = fcmp ogt float %7, 1.080000e+02
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %16
10: ; preds = %6
%11 = load float, float* %3
%12 = call float @llvm.fmuladd.f32(float %11, float 1.000000e+06, float 2.250000e+05)
%13 = fmul float 4.000000e+00, %12
%14 = fdiv float %13, 3.276800e+04
%15 = fptosi float %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @tea5767_mhz_to_regs(float %0) {
%2 = fcmp olt float %0, 7.600000e+01
%3 = fcmp ogt float %0, 1.080000e+02
%4 = or i1 %2, %3
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = tail call float @llvm.fmuladd.f32(float %0, float 1.000000e+06, float 2.250000e+05)
%7 = fmul float %6, 4.000000e+00
%8 = fmul float %7, 0x3F00000000000000
%9 = fptosi float %8 to i32
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ 0, %1 ]
ret i32 %11
}
void command_loop() {}


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

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

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

LLVM IR (-O2):
define void @command_loop() {
ret void
}
char *strcat(char *s1, char *s2) {
  char *os1;
  os1 = s1;
  while (*s1++) {
    ;
  }
  --s1;
  while (((*s1++) = (*s2++))) {
    ;
  }
  return os1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1131 <strcat+0x31>
jmp    1114 <strcat+0x14>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%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     116c <strcat+0x6c>
jmp    113d <strcat+0x3d>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ c1(int);
void c2(int param1) {
  if ((param1 & 0x1) != 0) {
    c1(param1);
  }
  return;
}


x86 assembly (clang, -O0):
<c2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1132 <c2+0x22>
mov    -0x4(%rbp),%edi
call   1030 <c1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2>:
test   $0x1,%dil
jne    1117 <c2+0x7>
ret
jmp    1030 <c1@plt>

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

LLVM IR (-O2):
define void @c2(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @c1(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint GetNewMagicValue(uint xValue) {
  uint x;
  x = (((((((xValue << 1) + xValue) << 5) - xValue) << 5) + xValue) << 7) -
      xValue;
  x = (x << 6) - x;
  x = (x << 4) - x;
  return ((x << 2) - x) + 12345;
}


x86 assembly (clang, -O0):
<GetNewMagicValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    -0x4(%rbp),%eax
shl    $0x5,%eax
sub    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0x4(%rbp),%eax
shl    $0x7,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x6,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
sub    -0x8(%rbp),%eax
add    $0x3039,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNewMagicValue>:
imul   $0x41c64e6d,%edi,%eax
add    $0x3039,%eax
ret

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

LLVM IR (-O2):
define i32 @GetNewMagicValue(i32 %0) {
%2 = mul i32 %0, 1103515245
%3 = add nsw i32 %2, 12345
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ BUG();
void outl(unsigned int x, unsigned long port) { BUG(); }


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

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

LLVM IR (-O0):
define void @outl(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i64 %1) {
%3 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
int log(int);
double atanh(double x) { return log((1 + x) / (1 - x)) / 2; }


x86 assembly (clang, -O0):
<atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanh>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
%9 = call i32 @log(i32 %8)
%10 = sdiv i32 %9, 2
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @atanh(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fdiv double %2, %3
%5 = fptosi double %4 to i32
%6 = tail call i32 @log(i32 %5)
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
float logf(float);
float c_log(float a, float b) { return logf(a) / logf(b); }


x86 assembly (clang, -O0):
<c_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_log>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <logf@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <logf@plt>
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @c_log(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @logf(float %5)
%7 = load float, float* %4
%8 = call float @logf(float %7)
%9 = fdiv float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @c_log(float %0, float %1) {
%3 = tail call float @logf(float %0)
%4 = tail call float @logf(float %1)
%5 = fdiv float %3, %4
ret float %5
}
void xnarch_chain_irq(unsigned irq) {}


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

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

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

LLVM IR (-O2):
define void @xnarch_chain_irq(i32 %0) {
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *arg_basename(const char *filename) {
  const char *result = (filename ? strrchr(filename, '/') : NULL);
  if (result)
    result++;
  else
    result = filename;
  return result;
}


x86 assembly (clang, -O0):
<arg_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <arg_basename+0x2e>
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
jmp    1149 <arg_basename+0x39>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1149 <arg_basename+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <arg_basename+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <arg_basename+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_basename>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1128 <arg_basename+0x18>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
jmp    112a <arg_basename+0x1a>
xor    %eax,%eax
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @arg_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i8* @strrchr(i8* %7, i8 signext 47)
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i8* [ %8, %6 ], [ null, %9 ]
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %19
17: ; preds = %10
%18 = load i8*, i8** %2
store i8* %18, i8** %3
br label %19
19: ; preds = %17, %14
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @arg_basename(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
%7 = icmp eq i8* %6, null
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = select i1 %7, i8* %0, i8* %8
ret i8* %9
}
double f4_sum_short_post_int(short v, int v0) {
  return (double)v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_short_post_int>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movswl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_short_post_int>:
cvtsi2sd %esi,%xmm1
cvtsi2sd %edi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_short_post_int(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load i16, i16* %3
%8 = sitofp i16 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_short_post_int(i16 signext %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = sitofp i16 %0 to double
%5 = fadd double %4, %3
ret double %5
}
unsigned xrop3_180_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_180_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_180_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_180_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_180_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char a[100];
  char *dest = a;
  char src[100] = "hello, world";
  puts(strcpy(dest, src));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
mov    -0x78(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %eax,%edi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xd8,%rsp
movaps 0xf22(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0x70(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <strcpy@plt>
mov    %eax,%edi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

LLVM IR (-O0):
@__const.main.src = [100 x i8] c"hello, world\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i8*
%4 = alloca [100 x i8]
store i32 0, i32* %1
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = bitcast [100 x i8]* %4 to i8*
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = call i32 @puts(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [100 x i8] c"hello, world\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %3, i8* %4)
%6 = call i32 @puts(i32 %5)
ret i32 0
}
int meson_test_subproj_foo(void) { return 20; }


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

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

LLVM IR (-O0):
define i32 @meson_test_subproj_foo() {
ret i32 20
}

LLVM IR (-O2):
define i32 @meson_test_subproj_foo() {
ret i32 20
}
/* Type definitions */
struct bv {
  int dummy;
};
struct boolean_vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bv *);
void _destroy(struct boolean_vector *pi) {
  struct bv *po = (struct bv *)pi;
  if (po)
    free(po);
}


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

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

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

LLVM IR (-O2):
%struct.boolean_vector = type { i32 }
%struct.bv = type { i32 }
define void @_destroy(%struct.boolean_vector* %0) {
%2 = icmp eq %struct.boolean_vector* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast %struct.boolean_vector* %0 to %struct.bv*
%5 = tail call i32 @free(%struct.bv* %4)
br label %6
6: ; preds = %3, %1
ret void
}
void XkbGetXlibControls() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetXlibControls() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int do3(int x) {
  printf("do3 %d</do3>\n", x);
  return x + 4;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"do3 %d</do3>\0A\00"
define i32 @do3(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add nsw i32 %0, 4
ret i32 %3
}
void termop_newline(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      404, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x194,%r8d
lea    0xf37(%rip),%r9
lea    0xf3f(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_newline>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf66(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x194,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_newline = [15 x i8] c"termop_newline\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_newline(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 404, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_newline, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_newline = [15 x i8] c"termop_newline\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_newline(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 404, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_newline, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
int Max(int A, int B) { return (A < B ? B : A); }


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

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

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

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int doesFileExist(const char *filename) {
  FILE *fp = fopen(filename, "r");
  if (fp) {
    fclose(fp);
    return 1;
  } else {
    if (errno == ENOENT)
      return 0;
    else
      return 1;
  }
}


x86 assembly (clang, -O0):
<doesFileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <doesFileExist+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    118d <doesFileExist+0x6d>
mov    0x2e79(%rip),%rax
mov    (%rax),%rax
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%rax
jne    1186 <doesFileExist+0x66>
movl   $0x0,-0x4(%rbp)
jmp    118d <doesFileExist+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doesFileExist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <doesFileExist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x2e98(%rip),%rax
mov    (%rax),%rcx
mov    0x2e7e(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@errno = global i64 0
@ENOENT = global i64 0
define i32 @doesFileExist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %11
6: ; preds = %1
%7 = load i64, i64* @errno
%8 = load i64, i64* @ENOENT
%9 = icmp ne i64 %7, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ %10, %6 ]
ret i32 %12
}
int cadd3(int a, int b, int c) { return a + b + c; }


x86 assembly (clang, -O0):
<cadd3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cadd3>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cadd3(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 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cadd3(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
int chk_rej(char *lp1, char *lp2) {
  int i;
  i = 0;
  return i;
}


x86 assembly (clang, -O0):
<chk_rej>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @chk_rej(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_UNAVAIL;
enum nss_status _nss_dev_tld_gethostbyaddr_r(const void *addr, int len, int af,
                                             struct hostent *result,
                                             char *buffer, size_t buflen,
                                             int *errnop, int *h_errnop) {
  return NSS_STATUS_UNAVAIL;
}


x86 assembly (clang, -O0):
<_nss_dev_tld_gethostbyaddr_r>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.hostent = type { i32 }
@NSS_STATUS_UNAVAIL = global i32 0
define i32 @_nss_dev_tld_gethostbyaddr_r(i8* %0, i32 %1, i32 %2, %struct.hostent* %3, i8* %4, i64 %5, i32* %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.hostent*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32*
%16 = alloca i32*
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store %struct.hostent* %3, %struct.hostent** %12
store i8* %4, i8** %13
store i64 %5, i64* %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%17 = load i32, i32* @NSS_STATUS_UNAVAIL
ret i32 %17
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@NSS_STATUS_UNAVAIL = global i32 0
define i32 @_nss_dev_tld_gethostbyaddr_r(i8* nocapture readnone %0, i32 %1, i32 %2, %struct.hostent* nocapture readnone %3, i8* nocapture readnone %4, i64 %5, i32* nocapture readnone %6, i32* nocapture readnone %7) {
%9 = load i32, i32* @NSS_STATUS_UNAVAIL
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int krash_fileno(FILE *f) { return fileno(f); }


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

x86 assembly (clang, -O2):
<krash_fileno>:
jmp    1030 <fileno@plt>

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

LLVM IR (-O2):
define i32 @krash_fileno(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
ret i32 %2
}
int main() {
  float i = 0;
  while (1) {
    i += 1;
    i -= 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee5(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xec9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  %xmm0,-0x8(%rbp)
jmp    1113 <main+0x13>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
br label %3
3: ; preds = %0, %3
%4 = load float, float* %2
%5 = fadd float %4, 1.000000e+00
store float %5, float* %2
%6 = load float, float* %2
%7 = fsub float %6, 1.000000e+00
store float %7, float* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}