xunge/DecIR huggingface dataset:
/* Variables and functions */
double pow(double, double);
double strtoul(char const *, int /*<<< orphan*/ *, int);
double add_dp(const char *str, int dp) {
  return strtoul(str, NULL, 10) / pow(10.0, (double)dp);
}


x86 assembly (clang, -O0):
<add_dp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xead(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_dp>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
movsd  %xmm0,0x8(%rsp)
cvtsi2sd %ebx,%xmm1
movsd  0xebb(%rip),%xmm0
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @add_dp(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 = call double @strtoul(i8* %5, i32* null, i32 10)
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call double @pow(double 1.000000e+01, double %8)
%10 = fdiv double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @add_dp(i8* nocapture %0, i32 %1) {
%3 = tail call double @strtoul(i8* nocapture %0, i32* null, i32 10)
%4 = sitofp i32 %1 to double
%5 = tail call double @pow(double 1.000000e+01, double %4)
%6 = fdiv double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ closelogfile();
int /*<<< orphan*/ openlogfile(int);
int /*<<< orphan*/ verbose(int, char *);
int rotatelogfile(void) {
  verbose(-1, "SIGHUP receive - close and reopen logfile.");
  closelogfile();
  openlogfile(1);
  return (0);
}


x86 assembly (clang, -O0):
<rotatelogfile>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
lea    0xec0(%rip),%rsi
call   1050 <verbose@plt>
mov    $0x0,%al
call   1030 <closelogfile@plt>
mov    $0x1,%edi
call   1040 <openlogfile@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotatelogfile>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0xffffffff,%edi
call   1050 <verbose@plt>
xor    %eax,%eax
call   1030 <closelogfile@plt>
mov    $0x1,%edi
call   1040 <openlogfile@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"SIGHUP receive - close and reopen logfile.\00"
define i32 @rotatelogfile() {
%1 = call i32 @verbose(i32 -1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @closelogfile()
%3 = call i32 @openlogfile(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"SIGHUP receive - close and reopen logfile.\00"
define i32 @rotatelogfile() {
%1 = tail call i32 @verbose(i32 -1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @closelogfile()
%3 = tail call i32 @openlogfile(i32 1)
ret i32 0
}
void ieee80211_debugfs_change_if_type(struct ieee80211_sub_if_data *sdata,
                                      int oldtype) {}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_sub_if_data = type opaque
define void @ieee80211_debugfs_change_if_type(%struct.ieee80211_sub_if_data* nocapture %0, i32 %1) {
ret void
}
void outputCCode(codeBuffer) char *codeBuffer;
{
  printf("%s\n", codeBuffer);
  free(codeBuffer);
}


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

x86 assembly (clang, -O2):
<outputCCode>:
push   %rbx
mov    %rdi,%rbx
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @outputCCode(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
tail call void @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int isakmp_debug_attribute(u_int16_t type, u_int8_t *value, u_int16_t len,
                           void *vmsg) {
  return 0;
}


x86 assembly (clang, -O0):
<isakmp_debug_attribute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isakmp_debug_attribute(i32 %0, i32* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @isakmp_debug_attribute(i32 %0, i32* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_alloc__(int);
void *ECDA_do_sign(void *pdigest, int digest, void *key) {
  __coverity_alloc__(digest);
}


x86 assembly (clang, -O0):
<ECDA_do_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <__coverity_alloc__@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECDA_do_sign>:
mov    %esi,%edi
jmp    1030 <__coverity_alloc__@plt>

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

LLVM IR (-O2):
define noalias i8* @ECDA_do_sign(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @__coverity_alloc__(i32 %1)
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t nowtime = time(NULL);
  printf("%s", ctime(&nowtime));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @time(i32* null)
store i32 %7, i32* %6
%8 = call i8* @ctime(i32* %6)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call i8* @ctime(i32* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
unsigned long wimaxll_be32_to_cpu(unsigned long be32) {
  unsigned long cpu;
  cpu = be32;
  return cpu;
}


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

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

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

LLVM IR (-O2):
define i64 @wimaxll_be32_to_cpu(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int fclose(int /*<<< orphan*/ *);
int ec_fclose(FILE *fp) {
  int return_val = fclose(fp);
  if (return_val != 0)
    fatal("in ec_close()");
  return return_val;
}


x86 assembly (clang, -O0):
<ec_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <ec_fclose+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <fatal@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_fclose>:
push   %rbx
call   1030 <fclose@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1138 <ec_fclose+0x18>
lea    0xecd(%rip),%rdi
call   1040 <fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"in ec_close()\00"
define i32 @ec_fclose(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __v2si;
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ia32_storehps(int /*<<< orphan*/ *,
                                           int /*<<< orphan*/);
void __attribute__((__always___)) _mm_storeh_pi(__m64 *p, __m128 a) {
  __builtin_ia32_storehps((__v2si *)p, a);
}


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

x86 assembly (clang, -O2):
<_mm_storeh_pi>:
jmp    1030 <__builtin_ia32_storehps@plt>

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

LLVM IR (-O2):
define void @_mm_storeh_pi(i32* %0, i32 %1) {
%3 = tail call i32 @__builtin_ia32_storehps(i32* %0, i32 %1)
ret void
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_atom_format_5_1(unsigned char const *, struct stream *);
int decode_atom_format_5_4(const unsigned char *pkt, struct stream *stream) {
  return decode_atom_format_5_1(pkt, stream);
}


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

x86 assembly (clang, -O2):
<decode_atom_format_5_4>:
jmp    1030 <decode_atom_format_5_1@plt>

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

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_atom_format_5_4(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_atom_format_5_1(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dgesv_(int *, int *, double *, int *, int *, double *, int *,
                          int *);
void GESV(int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb,
          int info) {
  dgesv_(&n, &nrhs, a, &lda, ipiv, b, &ldb, &info);
}


x86 assembly (clang, -O0):
<GESV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    0x10(%rbp),%r10
lea    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dgesv_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GESV>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0xc(%rsp)
lea    0x28(%rsp),%rax
lea    0x20(%rsp),%r10
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
push   %rax
push   %r10
call   1030 <dgesv_@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @GESV(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store double* %2, double** %11
store i32 %3, i32* %12
store i32* %4, i32** %13
store double* %5, double** %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load double*, double** %11
%18 = load i32*, i32** %13
%19 = load double*, double** %14
%20 = call i32 @dgesv_(i32* %9, i32* %10, double* %17, i32* %12, i32* %18, double* %19, i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @GESV(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %3, i32* %11
store i32 %6, i32* %12
store i32 %7, i32* %13
%14 = call i32 @dgesv_(i32* %9, i32* %10, double* %2, i32* %11, i32* %4, double* %5, i32* %12, i32* %13)
ret void
}
int trim_nl(char *str) {
  while ((*str != '\n') && (*str != '\0'))
    str++;
  if (*str == '\0')
    return 1;
  else {
    *str = '\0';
    return 0;
  }
}


x86 assembly (clang, -O0):
<trim_nl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     112d <trim_nl+0x2d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113d <trim_nl+0x3d>
jmp    114e <trim_nl+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <trim_nl+0x8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116a <trim_nl+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    1178 <trim_nl+0x78>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_nl>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <trim_nl+0x11>
cmp    $0xa,%al
je     1117 <trim_nl+0x17>
add    $0x1,%rdi
jmp    1100 <trim_nl>
mov    $0x1,%eax
ret
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @trim_nl(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
store i8 0, i8* %3
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void clear_scr() {
  printf("\033[2J\033[1;1H");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<clear_scr>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_scr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
@stdout = global i32 0
define void @clear_scr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
@stdout = global i32 0
define void @clear_scr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
int floatcmp(const void *a, const void *b) {
  const double ia = *((const double *)a);
  const double ib = *((const double *)b);
  if (ia < ib)
    return -1;
  if (ia > ib)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<floatcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <floatcmp+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <floatcmp+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <floatcmp+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <floatcmp+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatcmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @floatcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int foo(int r, int *p, int *q) {
  *p = r;
  return *q;
}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32* nocapture writeonly %1, i32* nocapture %2) {
store i32 %0, i32* %1
%4 = load i32, i32* %2
ret i32 %4
}
int foo_3() { return 1334; }


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

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

LLVM IR (-O0):
define i32 @foo_3() {
ret i32 1334
}

LLVM IR (-O2):
define i32 @foo_3() {
ret i32 1334
}
void mt_trace_hrt_end(void *func) {}


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

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

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

LLVM IR (-O2):
define void @mt_trace_hrt_end(i8* nocapture %0) {
ret void
}
float sub_float(float a, float b) { return a - b; }


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

x86 assembly (clang, -O2):
<sub_float>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sub_float(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 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @sub_float(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ssd1306_write_command(int);
uint8_t ssd1306_set_contrast(uint8_t contrast) {
  ssd1306_write_command(0x81);
  ssd1306_write_command(contrast);
  return contrast;
}


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

x86 assembly (clang, -O2):
<ssd1306_set_contrast>:
push   %rbx
mov    %edi,%ebx
mov    $0x81,%edi
call   1030 <ssd1306_write_command@plt>
mov    %ebx,%edi
call   1030 <ssd1306_write_command@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ssd1306_set_contrast(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ssd1306_write_command(i32 129)
%4 = load i32, i32* %2
%5 = call i32 @ssd1306_write_command(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @ssd1306_set_contrast(i32 returned %0) {
%2 = tail call i32 @ssd1306_write_command(i32 129)
%3 = tail call i32 @ssd1306_write_command(i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int, char *);
void finish(int sig) {
  syslog(6, "test finish");
  closelog();
  exit(0);
}


x86 assembly (clang, -O0):
<finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x6,%edi
lea    0xeb9(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<finish>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x6,%edi
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"test finish\00"
define void @finish(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @syslog(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @closelog()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"test finish\00"
define void @finish(i32 %0) {
%2 = tail call i32 @syslog(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @closelog()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpeq_pd(__m128d A, __m128d B) { return _mm_cmpeq_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpeq_pd>:
jmp    1030 <_mm_cmpeq_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpeq_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int);
int /*<<< orphan*/ main2(int);
int main(void) {
  check_vect();
  main1(16);
  main2(16);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x10,%edi
call   1040 <main1@plt>
mov    $0x10,%edi
call   1050 <main2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_vect()
%3 = call i32 @main1(i32 16)
%4 = call i32 @main2(i32 16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 16)
%3 = tail call i32 @main2(i32 16)
ret i32 0
}
void gll_coordinates_order2_square(double *out_2127667241337835057) {
  out_2127667241337835057[0] = -1.0;
  out_2127667241337835057[1] = 0.0;
  out_2127667241337835057[2] = 1.0;
}


x86 assembly (clang, -O0):
<gll_coordinates_order2_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll_coordinates_order2_square>:
movsd  0xef8(%rip),%xmm0
movups %xmm0,(%rdi)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @gll_coordinates_order2_square(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double -1.000000e+00, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0.000000e+00, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 2
store double 1.000000e+00, double* %8
ret void
}

LLVM IR (-O2):
define void @gll_coordinates_order2_square(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double -1.000000e+00, double 0.000000e+00>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
store double 1.000000e+00, double* %3
ret void
}
float convert_deg_to_rad(float th_deg) {
  float deg_to_rad = 3.141592653 / 180.0;
  return th_deg * deg_to_rad;
}


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

x86 assembly (clang, -O2):
<convert_deg_to_rad>:
mulss  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @convert_deg_to_rad(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor(300))) void init_func300(void) {
  printf("init_func with priority 300\n");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"init_func with priority 300\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 300, void ()* @init_func300, i8* null }]
define void @init_func300() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 300, void ()* @init_func300, i8* null }]
@str = [28 x i8] c"init_func with priority 300\00"
define void @init_func300() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pci_write_config_byte(struct pci_dev *, int, int);
void quirk_sb1250_pci(struct pci_dev *dev) {
  pci_write_config_byte(dev, 0x40, 0xff);
}


x86 assembly (clang, -O0):
<quirk_sb1250_pci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
mov    $0xff,%edx
call   1030 <pci_write_config_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quirk_sb1250_pci>:
mov    $0x40,%esi
mov    $0xff,%edx
jmp    1030 <pci_write_config_byte@plt>

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
define void @quirk_sb1250_pci(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load %struct.pci_dev*, %struct.pci_dev** %2
%4 = call i32 @pci_write_config_byte(%struct.pci_dev* %3, i32 64, i32 255)
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
define void @quirk_sb1250_pci(%struct.pci_dev* %0) {
%2 = tail call i32 @pci_write_config_byte(%struct.pci_dev* %0, i32 64, i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ circularGeometricMedian(int, int, double *, double, int,
                                           int *, double *);
void _R__circularGeometricMedian(int *n, int *p, double *angles, double *eps,
                                 int *maxiter, int *maxiter_flag,
                                 double *median) {
  circularGeometricMedian(*n, *p, angles, *eps, *maxiter, maxiter_flag, median);
}


x86 assembly (clang, -O0):
<_R__circularGeometricMedian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
call   1030 <circularGeometricMedian@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_R__circularGeometricMedian>:
mov    %r9,%rax
mov    0x8(%rsp),%r9
mov    (%rdi),%edi
mov    (%rsi),%esi
movsd  (%rcx),%xmm0
mov    (%r8),%ecx
mov    %rax,%r8
jmp    1030 <circularGeometricMedian@plt>

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

LLVM IR (-O2):
define void @_R__circularGeometricMedian(i32* nocapture %0, i32* nocapture %1, double* %2, double* nocapture %3, i32* nocapture %4, i32* %5, double* %6) {
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = load double, double* %3
%11 = load i32, i32* %4
%12 = tail call i32 @circularGeometricMedian(i32 %8, i32 %9, double* %2, double %10, i32 %11, i32* %5, double* %6)
ret void
}
int g(int x[10]) {}


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

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

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

LLVM IR (-O2):
define i32 @g(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned int la_objclose(uintptr_t *cookie) {
  printf("objclose\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"objclose\00"
define i32 @la_objclose(i64* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xcirculaterequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcirculaterequest_type(void *_p, int _v) {
  ((XEvent *)_p)->xcirculaterequest.type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xcirculaterequest_type>:
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_XEvent_xcirculaterequest_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcirculaterequest_type(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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcirculaterequest_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void gtk_rc_find_module_in_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_find_module_in_path() {
ret void
}
void resetArr(int len, char *reset) {
  for (int i = 0; i < len; ++i) {
    reset[i] = 0;
  }
}


x86 assembly (clang, -O0):
<resetArr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <resetArr+0x38>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <resetArr+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetArr>:
test   %edi,%edi
jle    1125 <resetArr+0x15>
push   %rax
mov    %edi,%edx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @resetArr(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %2
ret void
}
int main(void) {
  printf("%s\n", hello());
  printf("%#lx\n", (unsigned long)hello);
  printf("%p\n", hello);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <hello@plt>
mov    %eax,%esi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    0x2e9c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    0x2e87(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <hello@plt>
mov    0x2ec1(%rip),%rbx
lea    0xeda(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"%#lx\0A\00"
@.str.2 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @hello()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 ptrtoint (i32 (...)* @hello to i64))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 (...)* @hello)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"%#lx\0A\00"
@.str.2 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @hello()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 ptrtoint (i32 (...)* @hello to i64))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 (...)* @hello)
ret i32 0
}
int main(void) {
  asm volatile("main_label: .globl main_label");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "main_label: .globl main_label", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int, char *);
int /*<<< orphan*/ stdout;
void print_string_as_error(char *filename, int lineNumber, char *string) {
  printf("  %s:%d: %s", filename, lineNumber, string);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_string_as_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string_as_error>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [12 x i8] c" %s:%d: %s\00"
@stdout = global i32 0
define void @print_string_as_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" %s:%d: %s\00"
@stdout = global i32 0
define void @print_string_as_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void malformed_events(void) {
  fprintf(stderr, "oprofiled: malformed events passed "
                  "on the command line\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<malformed_events>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<malformed_events>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"oprofiled: malformed events passed on the command line\0A\00"
@EXIT_FAILURE = global i32 0
define void @malformed_events() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"oprofiled: malformed events passed on the command line\0A\00"
@EXIT_FAILURE = global i32 0
define void @malformed_events() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _plot_finish();
void plot_finish(void) { _plot_finish(); }


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

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

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

LLVM IR (-O2):
define void @plot_finish() {
%1 = tail call i32 (...) @_plot_finish()
ret void
}
void ft_strclr(char *s) {
  int i;
  i = 0;
  if (*s) {
    while (s[i] != '\0') {
      s[i] = '\0';
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <ft_strclr+0x55>
jmp    1121 <ft_strclr+0x21>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <ft_strclr+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <ft_strclr+0x21>
jmp    1155 <ft_strclr+0x55>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
store i8 0, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}