xunge/DecIR huggingface dataset:
int null_eol(char *s) {
  char *a;
  char eol;
  eol = '\n';
  for (a = s; *a != (char)0; a++)
    if (*a == eol) {
      *a = (char)0;
      return (1);
    }
  return (0);
}


x86 assembly (clang, -O0):
<null_eol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movb   $0xa,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <null_eol+0x60>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <null_eol+0x4a>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1167 <null_eol+0x67>
jmp    114f <null_eol+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <null_eol+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @null_eol(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ glmRadians3f_(float *);
void glmCosD3f_(float angle[3]) {
  glmRadians3f_(angle);
  glmCosD3f_(angle);
}


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

x86 assembly (clang, -O2):
<glmCosD3f_>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <glmRadians3f_@plt>
jmp    1120 <glmCosD3f_+0x10>

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

LLVM IR (-O2):
define void @glmCosD3f_(float* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @glmRadians3f_(float* %0)
br label %2
}
int mkstemp(template) char *template;
{ return __gen_tempname(template, 0, 0, 0); }


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <__gen_tempname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemp>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1030 <__gen_tempname@plt>

LLVM IR (-O0):
define i32 @mkstemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @__gen_tempname to i32 (i8*, i32, i32, i32, ...)*)(i8* %3, i32 0, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @mkstemp(i8* %0) {
%2 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @__gen_tempname to i32 (i8*, i32, i32, i32, ...)*)(i8* %0, i32 0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int f183(int *);
int f184(int *p) { return f183(p); }


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

x86 assembly (clang, -O2):
<f184>:
jmp    1030 <f183@plt>

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

LLVM IR (-O2):
define i32 @f184(i32* %0) {
%2 = tail call i32 @f183(i32* %0)
ret i32 %2
}
/* Variables and functions */
int libaft_internal_surfmeshrefiner_lim_setup(double);
int surface_refine_setup_lim(double lim) {
  return libaft_internal_surfmeshrefiner_lim_setup(lim);
}


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

x86 assembly (clang, -O2):
<surface_refine_setup_lim>:
jmp    1030 <libaft_internal_surfmeshrefiner_lim_setup@plt>

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

LLVM IR (-O2):
define i32 @surface_refine_setup_lim(double %0) {
%2 = tail call i32 @libaft_internal_surfmeshrefiner_lim_setup(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
void U_EMRBEGINPATH_swap(char *record, int torev) { core5_swap(record, torev); }


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

x86 assembly (clang, -O2):
<U_EMRBEGINPATH_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRBEGINPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void hazer_checksum(uint8_t ch, uint8_t *csp) { *csp ^= ch; }


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

x86 assembly (clang, -O2):
<hazer_checksum>:
xor    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @hazer_checksum(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 = load i32, i32* %6
%8 = xor i32 %7, %5
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @hazer_checksum(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = xor i32 %3, %0
store i32 %4, i32* %1
ret void
}
char *hc_name_boolean(value)
unsigned short value;
{
  if (value)
    return ("ON");
  else
    return ("OFF");
}


x86 assembly (clang, -O0):
<hc_name_boolean>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
cmpw   $0x0,-0xa(%rbp)
je     1126 <hc_name_boolean+0x26>
lea    0xee3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <hc_name_boolean+0x31>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hc_name_boolean>:
test   %di,%di
lea    0xef9(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ON\00"
@.str.1 = [4 x i8] c"OFF\00"
define i8* @hc_name_boolean(i32 %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = trunc i32 %0 to i16
store i16 %4, i16* %3
%5 = load i16, i16* %3
%6 = icmp ne i16 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"ON\00"
@.str.1 = [4 x i8] c"OFF\00"
define i8* @hc_name_boolean(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ yazdir(int *, int *);
void soru_7(int dizi[]) {
  yazdir(dizi, dizi + 9);
  yazdir(dizi + 3, dizi + 6);
}


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

x86 assembly (clang, -O2):
<soru_7>:
push   %rbx
mov    %rdi,%rbx
lea    0x24(%rdi),%rsi
call   1030 <yazdir@plt>
lea    0xc(%rbx),%rdi
add    $0x18,%rbx
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <yazdir@plt>

LLVM IR (-O0):
define void @soru_7(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 9
%6 = call i32 @yazdir(i32* %3, i32* %5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 6
%11 = call i32 @yazdir(i32* %8, i32* %10)
ret void
}

LLVM IR (-O2):
define void @soru_7(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = tail call i32 @yazdir(i32* %0, i32* %2)
%4 = getelementptr inbounds i32, i32* %0, i64 3
%5 = getelementptr inbounds i32, i32* %0, i64 6
%6 = tail call i32 @yazdir(i32* %4, i32* %5)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double randn() { return (rand() / (double)(RAND_MAX)); }


x86 assembly (clang, -O0):
<randn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randn>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randn() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randn() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
void pl111_nomadik_init(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @pl111_nomadik_init(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, char, size_t);
void *rtpp_zmalloc(size_t msize) {
  void *rval;
  rval = malloc(msize);
  if (rval != NULL) {
    memset(rval, '\0', msize);
  }
  return (rval);
}


x86 assembly (clang, -O0):
<rtpp_zmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <rtpp_zmalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtpp_zmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <rtpp_zmalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @rtpp_zmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i8 signext 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @rtpp_zmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i8 signext 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int atoi(char const *);
const char *getnum(const char *n, int *num) {
  *num = atoi(n);
  while (*n >= '0' && *n <= '9')
    n++;
  return n;
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     1156 <getnum+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1166 <getnum+0x56>
jmp    1177 <getnum+0x67>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <getnum+0x21>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <atoi@plt>
mov    %eax,(%r14)
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
add    $0xd0,%al
cmp    $0xa,%al
jb     1130 <getnum+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getnum(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 i32 @atoi(i8* %5)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
br label %8
8: ; preds = %20, %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 48
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 57
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ false, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %8
23: ; preds = %18
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @getnum(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @atoi(i8* %0)
store i32 %3, i32* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %0, %2 ], [ %9, %4 ]
%6 = load i8, i8* %5
%7 = add i8 %6, -48
%8 = icmp ult i8 %7, 10
%9 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %8, label %4, label %10
10: ; preds = %4
ret i8* %5
}
int kol_clip_num() { asm volatile("int $0x40" ::"a"(54), "b"(0)); }


x86 assembly (clang, -O0):
<kol_clip_num>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x36,%eax
xor    %ebx,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_clip_num>:
push   %rbx
mov    $0x36,%eax
xor    %ebx,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_clip_num() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 54, i32 0)
ret i32 undef
}
/* Variables and functions */
bool nrf53_errata_86(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_86() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_86() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ceil(double);
long iRound(int /*<<< orphan*/);
long int iCeil(double f) { return iRound(ceil(f)); }


x86 assembly (clang, -O0):
<iCeil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <ceil@plt>
mov    %eax,%edi
call   1030 <iRound@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iCeil>:
push   %rax
call   1040 <ceil@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <iRound@plt>

LLVM IR (-O0):
define i64 @iCeil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @ceil(double %3)
%5 = call i64 @iRound(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @iCeil(double %0) {
%2 = tail call i32 @ceil(double %0)
%3 = tail call i64 @iRound(i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SessionManagingHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void SessionManagingRequestUpdate() {
  UAVObjRequestUpdate(SessionManagingHandle());
}


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

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

LLVM IR (-O0):
define void @SessionManagingRequestUpdate() {
%1 = call i32 (...) @SessionManagingHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SessionManagingRequestUpdate() {
%1 = tail call i32 (...) @SessionManagingHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int *g(int **);
int f(int **arr) {
  int *a = g(arr);
  return a[3];
}


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

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <g@plt>
mov    0xc(%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = call i32* @g(i32** %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 3
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32** %0) {
%2 = tail call i32* @g(i32** %0)
%3 = getelementptr inbounds i32, i32* %2, i64 3
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_MPYI(int r, int v) { C67_asm("MPYI.M", v, r, v); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"MPYI.M\00"
define void @C67_MPYI(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t csum_fold(uint32_t sum) {
  sum = (sum >> 16) + (sum & 0xffff);
  sum += (sum >> 16);
  return ~sum;
}


x86 assembly (clang, -O0):
<csum_fold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_fold>:
movzwl %di,%ecx
sar    $0x10,%edi
add    %edi,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
add    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @csum_fold(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 16
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = xor i32 %12, -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @csum_fold(i32 %0) {
%2 = ashr i32 %0, 16
%3 = and i32 %0, 65535
%4 = add nsw i32 %2, %3
%5 = ashr i32 %4, 16
%6 = add nsw i32 %5, %4
%7 = xor i32 %6, -1
ret i32 %7
}
void _libSC_info_fork_child(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ queue_lock_pop(struct queue *);
void *queue_pop_locked(struct queue *, void *);
int /*<<< orphan*/ queue_unlock_pop(struct queue *);
void *queue_pop(struct queue *q, void *elm) {
  void *ret;
  queue_lock_pop(q);
  ret = queue_pop_locked(q, elm);
  queue_unlock_pop(q);
  return ret;
}


x86 assembly (clang, -O0):
<queue_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <queue_lock_pop@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <queue_pop_locked@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <queue_unlock_pop@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_pop>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <queue_lock_pop@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <queue_pop_locked@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <queue_unlock_pop@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
define i8* @queue_pop(%struct.queue* %0, i8* %1) {
%3 = alloca %struct.queue*
%4 = alloca i8*
%5 = alloca i8*
store %struct.queue* %0, %struct.queue** %3
store i8* %1, i8** %4
%6 = load %struct.queue*, %struct.queue** %3
%7 = call i32 @queue_lock_pop(%struct.queue* %6)
%8 = load %struct.queue*, %struct.queue** %3
%9 = load i8*, i8** %4
%10 = call i8* @queue_pop_locked(%struct.queue* %8, i8* %9)
store i8* %10, i8** %5
%11 = load %struct.queue*, %struct.queue** %3
%12 = call i32 @queue_unlock_pop(%struct.queue* %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define i8* @queue_pop(%struct.queue* %0, i8* %1) {
%3 = tail call i32 @queue_lock_pop(%struct.queue* %0)
%4 = tail call i8* @queue_pop_locked(%struct.queue* %0, i8* %1)
%5 = tail call i32 @queue_unlock_pop(%struct.queue* %0)
ret i8* %4
}
/* Variables and functions */
double tanh(double);
double tanh_grad(double x) {
  double tx = tanh(x);
  return 1.0 - tx * tx;
}


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

x86 assembly (clang, -O2):
<tanh_grad>:
push   %rax
call   1030 <tanh@plt>
mulsd  %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tanh_grad(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @tanh(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fneg double %6
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @tanh_grad(double %0) {
%2 = tail call double @tanh(double %0)
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 1.000000e+00)
ret double %4
}
void quant_encode(int du[64], int qtab[64]) {
  int i;
  for (i = 0; i < 64; i++)
    du[i] /= qtab[i];
}


x86 assembly (clang, -O0):
<quant_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1151 <quant_encode+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <quant_encode+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quant_encode>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi,%rcx,4),%eax
mov    0x4(%rdi,%rcx,4),%r8d
cltd
idivl  (%rsi,%rcx,4)
mov    %eax,(%rdi,%rcx,4)
mov    %r8d,%eax
cltd
idivl  0x4(%rsi,%rcx,4)
mov    %eax,0x4(%rdi,%rcx,4)
add    $0x2,%rcx
cmp    $0x40,%rcx
jne    1110 <quant_encode+0x10>
ret

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

LLVM IR (-O2):
define void @quant_encode(i32* nocapture %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %16, %3 ]
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 %4
%8 = load i32, i32* %7
%9 = sdiv i32 %8, %6
store i32 %9, i32* %7
%10 = or i64 %4, 1
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = load i32, i32* %13
%15 = sdiv i32 %14, %12
store i32 %15, i32* %13
%16 = add nuw nsw i64 %4, 2
%17 = icmp eq i64 %16, 64
br i1 %17, label %18, label %3
18: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayUsBusy(int);
int /*<<< orphan*/ onewire_read_bit(int);
void max31850_wait_convertion(int pin) {
  while (!onewire_read_bit(pin)) {
  }
  delayUsBusy(480);
}


x86 assembly (clang, -O0):
<max31850_wait_convertion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <onewire_read_bit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1148 <max31850_wait_convertion+0x28>
jmp    114d <max31850_wait_convertion+0x2d>
jmp    112b <max31850_wait_convertion+0xb>
mov    $0x1e0,%edi
call   1030 <delayUsBusy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max31850_wait_convertion>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1040 <onewire_read_bit@plt>
test   %eax,%eax
je     1130 <max31850_wait_convertion+0x10>
mov    $0x1e0,%edi
pop    %rbx
jmp    1030 <delayUsBusy@plt>

LLVM IR (-O0):
define void @max31850_wait_convertion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = call i32 @onewire_read_bit(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = call i32 @delayUsBusy(i32 480)
ret void
}

LLVM IR (-O2):
define void @max31850_wait_convertion(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @onewire_read_bit(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @delayUsBusy(i32 480)
ret void
}
signed char uchar2schar(unsigned char x) { return x; }


x86 assembly (clang, -O0):
<uchar2schar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @uchar2schar(i8 returned zeroext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "usage: %s -a MISALIGNMENT -s SIZE\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s -a MISALIGNMENT -s SIZE\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s -a MISALIGNMENT -s SIZE\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, long);
void copy_dvector(double *src, long nl1, long nh1, double *dst, long nl2,
                  long nh2) {
  long len = nh1 - nl1 + 1;
  static long size = sizeof(double);
  memcpy(dst + nl2, src + nl1, len * size);
}


x86 assembly (clang, -O0):
<copy_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
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    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x38(%rbp),%rdx
imul   0x2ebe(%rip),%rdx
call   1030 <memcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dvector>:
sub    %rsi,%rdx
lea    (%rcx,%r8,8),%rax
lea    (%rdi,%rsi,8),%rsi
lea    0x8(,%rdx,8),%rdx
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@copy_dvector.size = internal global i64 8
define void @copy_dvector(double* %0, i64 %1, i64 %2, double* %3, i64 %4, i64 %5) {
%7 = alloca double*
%8 = alloca i64
%9 = alloca i64
%10 = alloca double*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store double* %0, double** %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store double* %3, double** %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%14 = load i64, i64* %9
%15 = load i64, i64* %8
%16 = sub nsw i64 %14, %15
%17 = add nsw i64 %16, 1
store i64 %17, i64* %13
%18 = load double*, double** %10
%19 = load i64, i64* %11
%20 = getelementptr inbounds double, double* %18, i64 %19
%21 = load double*, double** %7
%22 = load i64, i64* %8
%23 = getelementptr inbounds double, double* %21, i64 %22
%24 = load i64, i64* %13
%25 = load i64, i64* @copy_dvector.size
%26 = mul nsw i64 %24, %25
%27 = call i32 @memcpy(double* %20, double* %23, i64 %26)
ret void
}

LLVM IR (-O2):
define void @copy_dvector(double* %0, i64 %1, i64 %2, double* %3, i64 %4, i64 %5) {
%7 = sub nsw i64 %2, %1
%8 = getelementptr inbounds double, double* %3, i64 %4
%9 = getelementptr inbounds double, double* %0, i64 %1
%10 = shl i64 %7, 3
%11 = add i64 %10, 8
%12 = tail call i32 @memcpy(double* %8, double* %9, i64 %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *timeStringFromTimestamp(time_t timet, char *format) {
  int STRING_SIZE = 22;
  char *result = malloc(STRING_SIZE);
  if (result == NULL) {
  }
  struct tm *ptm = localtime(&timet);
  strftime(result, STRING_SIZE, format, ptm);
  return result;
}


x86 assembly (clang, -O0):
<timeStringFromTimestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x16,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1162 <timeStringFromTimestamp+0x32>
jmp    1162 <timeStringFromTimestamp+0x32>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1050 <strftime@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeStringFromTimestamp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,0x4(%rsp)
mov    $0x16,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @timeStringFromTimestamp(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.tm*
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 22, i32* %5
%8 = load i32, i32* %5
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %2
%14 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %14, %struct.tm** %7
%15 = load i8*, i8** %6
%16 = load i32, i32* %5
%17 = load i8*, i8** %4
%18 = load %struct.tm*, %struct.tm** %7
%19 = call i32 @strftime(i8* %15, i32 %16, i8* %17, %struct.tm* %18)
%20 = load i8*, i8** %6
ret i8* %20
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @timeStringFromTimestamp(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = tail call dereferenceable_or_null(22) i8* @malloc(i32 22)
%5 = call %struct.tm* @localtime(i32* %3)
%6 = call i32 @strftime(i8* %4, i32 22, i8* %1, %struct.tm* %5)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
char *strdup(char const *);
char *strdup_f(const char *s) {
  if (s == NULL)
    return NULL;
  char *d;
  if ((d = strdup(s)) == NULL) {
    perror("strdup");
    exit(EXIT_FAILURE);
  }
  return d;
}


x86 assembly (clang, -O0):
<strdup_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strdup_f+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118d <strdup_f+0x5d>
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1185 <strdup_f+0x55>
lea    0xe8e(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup_f>:
push   %rax
test   %rdi,%rdi
je     1142 <strdup_f+0x12>
call   1050 <strdup@plt>
test   %rax,%rax
je     1146 <strdup_f+0x16>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @strdup_f(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3, %1
%11 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int base58_decode_check(char const *, int /*<<< orphan*/ *, int);
int ecdsa_address_decode(const char *addr, uint8_t *out) {
  if (!addr)
    return 0;
  return base58_decode_check(addr, out, 21) == 21;
}


x86 assembly (clang, -O0):
<ecdsa_address_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <ecdsa_address_decode+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1157 <ecdsa_address_decode+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x15,%edx
call   1030 <base58_decode_check@plt>
cmp    $0x15,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecdsa_address_decode>:
test   %rdi,%rdi
je     112f <ecdsa_address_decode+0x1f>
push   %rax
mov    $0x15,%edx
call   1030 <base58_decode_check@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x15,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ecdsa_address_decode(i8* %0, i32* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @base58_decode_check(i8* %0, i32* %1, i32 21)
%6 = icmp eq i32 %5, 21
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
bugger() {
  int oldDepth, newDepth;
  foo(&oldDepth);
  switch (oldDepth) {
  case 8:
  case 500:
    newDepth = 8;
    break;
  case 5000:
    newDepth = 500;
    break;
  default:
    newDepth = 17;
    break;
  }
  return newDepth - oldDepth;
}


x86 assembly (clang, -O0):
<bugger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x8,%eax
je     115b <bugger+0x4b>
jmp    1135 <bugger+0x25>
mov    -0xc(%rbp),%eax
sub    $0x1f4,%eax
je     115b <bugger+0x4b>
jmp    1148 <bugger+0x38>
mov    -0xc(%rbp),%eax
sub    $0x1388,%eax
je     1167 <bugger+0x57>
jmp    1173 <bugger+0x63>
movl   $0x8,-0x8(%rbp)
jmp    117a <bugger+0x6a>
movl   $0x1f4,-0x8(%rbp)
jmp    117a <bugger+0x6a>
movl   $0x11,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bugger>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
mov    $0x8,%eax
mov    0x4(%rsp),%ecx
cmp    $0x8,%ecx
je     1145 <bugger+0x35>
cmp    $0x1f4,%ecx
je     1145 <bugger+0x35>
cmp    $0x1388,%ecx
jne    1140 <bugger+0x30>
mov    $0x1f4,%eax
jmp    1145 <bugger+0x35>
mov    $0x11,%eax
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bugger() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %7 [
i32 8, label %5
i32 500, label %5
i32 5000, label %6
]
5: ; preds = %0, %0
store i32 8, i32* %2
br label %8
6: ; preds = %0
store i32 500, i32* %2
br label %8
7: ; preds = %0
store i32 17, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = sub nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bugger() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %6 [
i32 8, label %7
i32 500, label %7
i32 5000, label %5
]
5: ; preds = %0
br label %7
6: ; preds = %0
br label %7
7: ; preds = %0, %0, %6, %5
%8 = phi i32 [ 17, %6 ], [ 500, %5 ], [ 8, %0 ], [ 8, %0 ]
%9 = sub nsw i32 %8, %4
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void print_hash(const uint8_t *hash) {
  for (int i = 0; i < 32; i++)
    printf("%02x", hash[i] & 0xff);
}


x86 assembly (clang, -O0):
<print_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1158 <print_hash+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
and    $0xff,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_hash+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1130 <print_hash+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_hash(i32* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %6, 255
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 32
br i1 %10, label %2, label %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int lrand48();
uint32_t get_random_psn(void) { return lrand48() & 0xffffff; }


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

x86 assembly (clang, -O2):
<get_random_psn>:
push   %rax
xor    %eax,%eax
call   1030 <lrand48@plt>
and    $0xffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_random_psn() {
%1 = call i32 (...) @lrand48()
%2 = and i32 %1, 16777215
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_random_psn() {
%1 = tail call i32 (...) @lrand48()
%2 = and i32 %1, 16777215
ret i32 %2
}
/* Type definitions */
struct derived {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void derived_destructor(struct derived *obj) {
  printf("derived_destructor!!\n");
}


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

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

LLVM IR (-O0):
%struct.derived = type { i32 }
@.str = [22 x i8] c"derived_destructor!!\0A\00"
define void @derived_destructor(%struct.derived* %0) {
%2 = alloca %struct.derived*
store %struct.derived* %0, %struct.derived** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.derived = type { i32 }
@str = [21 x i8] c"derived_destructor!!\00"
define void @derived_destructor(%struct.derived* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
void ag7240_phy_link(int unit, int *link) {
  {}
}


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

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

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

LLVM IR (-O2):
define void @ag7240_phy_link(i32 %0, i32* nocapture %1) {
ret void
}