xunge/DecIR huggingface dataset:
int d_blt_rr2(double a1, double a2) { return !(__builtin_isless(a1, a2)); }


x86 assembly (clang, -O0):
<d_blt_rr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blt_rr2>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_blt_rr2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_blt_rr2(double %0, double %1) {
%3 = fcmp uge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double timer_split(const double *t) {
  struct timeval tv;
  double cur_t;
  gettimeofday(&tv, NULL);
  cur_t = (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
  return (cur_t - *t);
}


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

x86 assembly (clang, -O2):
<timer_split>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x8(%rsp),%xmm1
cvtsi2sdq (%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
subsd  (%rbx),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @timer_split(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
%4 = alloca double
store double* %0, double** %2
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
store double %12, double* %4
%13 = load double, double* %4
%14 = load double*, double** %2
%15 = load double, double* %14
%16 = fsub double %13, %15
ret double %16
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @timer_split(double* nocapture %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
%12 = load double, double* %0
%13 = fsub double %11, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ WATCHDOG_REFRESH_RestoreConfig();
void WATCHDOG_REFRESH_Wakeup(void) { WATCHDOG_REFRESH_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @WATCHDOG_REFRESH_Wakeup() {
%1 = tail call i32 (...) @WATCHDOG_REFRESH_RestoreConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freestr(char **ptr) {
  if (*ptr)
    free(*ptr);
  *ptr = 0;
}


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

x86 assembly (clang, -O2):
<freestr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1121 <freestr+0x11>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @freestr(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
br label %6
6: ; preds = %4, %1
store i8* null, i8** %0
ret void
}
void external_clocks_off() {
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x04) =
      0x080 | 0x100 | 0x200 | 0x400;
}


x86 assembly (clang, -O0):
<external_clocks_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffc00,%eax
movq   $0x780,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<external_clocks_off>:
mov    $0xfffffc04,%eax
movq   $0x780,(%rax)
ret

LLVM IR (-O0):
define void @external_clocks_off() {
store volatile i64 1920, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 4) to i64*)
ret void
}

LLVM IR (-O2):
define void @external_clocks_off() {
store volatile i64 1920, i64* inttoptr (i64 4294966276 to i64*)
ret void
}
int divlen(char *a) {
  if (*a != '\0')
    return 1 + divlen(++a);
  else
    return 0;
}


x86 assembly (clang, -O0):
<divlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <divlen+0x38>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
call   1030 <divlen@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <divlen+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divlen>:
cmpb   $0x0,(%rdi)
je     111c <divlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <divlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @divlen(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 i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int os_IsAbsolutePath(char const *path) {
  if (!path)
    return 0;
  if (path[0] == '/')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<os_IsAbsolutePath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <os_IsAbsolutePath+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1142 <os_IsAbsolutePath+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113b <os_IsAbsolutePath+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <os_IsAbsolutePath+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_IsAbsolutePath>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <os_IsAbsolutePath+0xd>
cmpb   $0x2f,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @os_IsAbsolutePath(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 47
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void n_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @n_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
unsigned int __gnu_h2f_internal(unsigned short, int);
unsigned int __gnu_h2f_ieee(unsigned short a) {
  return __gnu_h2f_internal(a, 1);
}


x86 assembly (clang, -O0):
<__gnu_h2f_ieee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1,%esi
movzwl -0x2(%rbp),%edi
call   1030 <__gnu_h2f_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__gnu_h2f_ieee(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__gnu_h2f_internal(i16 zeroext %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @__gnu_h2f_ieee(i16 zeroext %0) {
%2 = tail call i32 @__gnu_h2f_internal(i16 zeroext %0, i32 1)
ret i32 %2
}
void no_cdx_stb(unsigned char *p, unsigned char x) { p[16] = x; }


x86 assembly (clang, -O0):
<no_cdx_stb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_cdx_stb>:
mov    %sil,0x10(%rdi)
ret

LLVM IR (-O0):
define void @no_cdx_stb(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 16
store i8 %5, i8* %7
ret void
}

LLVM IR (-O2):
define void @no_cdx_stb(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 16
store i8 %1, i8* %3
ret void
}
/* Variables and functions */
char *customStrdup(char *);
char *removeExtension(char *);
char *strrchr(char *, char);
char *getFileName(char *path) {
  char *s = strrchr(path, '/');
  if (!s)
    return removeExtension(customStrdup(path));
  char *result = customStrdup(s + 1);
  char *resultWithoutExt = removeExtension(result);
  return resultWithoutExt;
}


x86 assembly (clang, -O0):
<getFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <getFileName+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <customStrdup@plt>
mov    %rax,%rdi
call   1050 <removeExtension@plt>
mov    %rax,-0x8(%rbp)
jmp    1199 <getFileName+0x69>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <customStrdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <removeExtension@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     114c <getFileName+0x1c>
add    $0x1,%rax
mov    %rax,%rdi
jmp    114f <getFileName+0x1f>
mov    %rbx,%rdi
call   1030 <customStrdup@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <removeExtension@plt>

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

LLVM IR (-O2):
define i8* @getFileName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @customStrdup(i8* %0)
br label %9
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = tail call i8* @customStrdup(i8* %7)
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ %8, %6 ], [ %5, %4 ]
%11 = tail call i8* @removeExtension(i8* %10)
ret i8* %11
}
/* Variables and functions */
int ds1621_read_value(int, int);
int read_slope(int dev_fd) { return (ds1621_read_value(dev_fd, 0xA9)); }


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

x86 assembly (clang, -O2):
<read_slope>:
mov    $0xa9,%esi
jmp    1030 <ds1621_read_value@plt>

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

LLVM IR (-O2):
define i32 @read_slope(i32 %0) {
%2 = tail call i32 @ds1621_read_value(i32 %0, i32 169)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char const *);
double strtod(char const *, char **);
double estrtod(const char *s) {
  char *end;
  double d;
  d = strtod(s, &end);
  if (end == s || *end != '\0')
    eprintf("%s: not a real number\n", s);
  return d;
}


x86 assembly (clang, -O0):
<estrtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     115c <estrtod+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116c <estrtod+0x4c>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <eprintf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrtod>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <strtod@plt>
mov    0x8(%rsp),%rax
cmp    %rbx,%rax
je     1141 <estrtod+0x21>
cmpb   $0x0,(%rax)
je     115a <estrtod+0x3a>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
movsd  %xmm0,(%rsp)
call   1040 <eprintf@plt>
movsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%s: not a real number\0A\00"
define double @estrtod(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call double @strtod(i8* %5, i8** %3)
store double %6, double* %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = icmp eq i8* %7, %8
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10, %1
%16 = load i8*, i8** %2
%17 = call i32 @eprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %10
%19 = load double, double* %4
ret double %19
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s: not a real number\0A\00"
define double @estrtod(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call double @strtod(i8* %0, i8** %2)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7, %1
%11 = tail call i32 @eprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %7
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
  foo();
  foo();
  foo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
int main(int argc, char *argv[]) {
  char buf[8];
  const char *src = "helloworld";
  strcpy(buf, src);
  printf("%s\n", buf);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"helloworld\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
int netsh_main(int ac, const char *av[]) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @netsh_main(i32 %0, i8** nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int clock();
void SlowDown(void) {
  int start, current;
  start = clock();
  do {
    current = clock();
  } while (current - start < 50);
}


x86 assembly (clang, -O0):
<SlowDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x32,%eax
jl     1122 <SlowDown+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SlowDown>:
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
sub    %ebx,%eax
cmp    $0x32,%eax
jl     1120 <SlowDown+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @SlowDown() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @clock()
store i32 %3, i32* %1
br label %4
4: ; preds = %6, %0
%5 = call i32 (...) @clock()
store i32 %5, i32* %2
br label %6
6: ; preds = %4
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = sub nsw i32 %7, %8
%10 = icmp slt i32 %9, 50
br i1 %10, label %4, label %11
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @SlowDown() {
%1 = tail call i32 (...) @clock()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @clock()
%4 = sub nsw i32 %3, %1
%5 = icmp slt i32 %4, 50
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
OP(fd, f3) {
  illegal_1();
  op_f3();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f3()
ret i32 undef
}
/* Variables and functions */
char *to_ascii(unsigned char const *, int /*<<< orphan*/);
char *convert_from_utf16be(const unsigned char *utf16) {
  return to_ascii(utf16, 0);
}


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

x86 assembly (clang, -O2):
<convert_from_utf16be>:
xor    %esi,%esi
jmp    1030 <to_ascii@plt>

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

LLVM IR (-O2):
define i8* @convert_from_utf16be(i8* %0) {
%2 = tail call i8* @to_ascii(i8* %0, i32 0)
ret i8* %2
}
OP(dd, d8) { op_d8(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_d8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d8()
ret i32 undef
}
/* Variables and functions */
int __cxa_atexit(void (*)(), int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int atexit(void (*t)()) { return __cxa_atexit(t, NULL, NULL); }


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

x86 assembly (clang, -O2):
<atexit>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__cxa_atexit@plt>

LLVM IR (-O0):
define i32 @atexit(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
%3 = load void (...)*, void (...)** %2
%4 = call i32 @__cxa_atexit(void (...)* %3, i32* null, i32* null)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atexit(void (...)* %0) {
%2 = tail call i32 @__cxa_atexit(void (...)* %0, i32* null, i32* null)
ret i32 %2
}
/* Variables and functions */
scalar_t__ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log2(int);
int ceilPower2(int x) { return 1 << (int)ceil(log2(x)); }


x86 assembly (clang, -O0):
<ceilPower2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilPower2>:
push   %rax
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
mov    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ceilPower2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log2(i32 %3)
%5 = call i64 @ceil(i32 %4)
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ceilPower2(i32 %0) {
%2 = tail call i32 @log2(i32 %0)
%3 = tail call i64 @ceil(i32 %2)
%4 = trunc i64 %3 to i32
%5 = shl nuw i32 1, %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ wallclock_time();
double wallclock_time_(void) { return (double)wallclock_time(); }


x86 assembly (clang, -O0):
<wallclock_time_>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wallclock_time@plt>
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wallclock_time_>:
push   %rax
xor    %eax,%eax
call   1030 <wallclock_time@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @wallclock_time_() {
%1 = call i64 (...) @wallclock_time()
%2 = sitofp i64 %1 to double
ret double %2
}

LLVM IR (-O2):
define double @wallclock_time_() {
%1 = tail call i64 (...) @wallclock_time()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_setzero_si128();
int /*<<< orphan*/ _mm_unpacklo_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
extern __attribute__((__gnu___, __always___, __artificial__)) __m128i
_MM_CVTEPU32_EPI64(__m128i a) {
  __m128i zero = _mm_setzero_si128();
  return _mm_unpacklo_epi32(a, zero);
}


x86 assembly (clang, -O0):
<_MM_CVTEPU32_EPI64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_unpacklo_epi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MM_CVTEPU32_EPI64>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <_mm_unpacklo_epi32@plt>

LLVM IR (-O0):
define i32 @_MM_CVTEPU32_EPI64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @_mm_setzero_si128()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @_mm_unpacklo_epi32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_MM_CVTEPU32_EPI64(i32 %0) {
%2 = tail call i32 (...) @_mm_setzero_si128()
%3 = tail call i32 @_mm_unpacklo_epi32(i32 %0, i32 %2)
ret i32 %3
}
void __attribute__((__no_instrument_function__))
__cyg_profile_func_exit(void *this_func, void *call_site) {
  printf("%s: func = %p, called by = %p\r\n", __FUNCTION__, this_func,
         call_site);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"%s: func = %p, called by = %p\0D\0A\00"
@__FUNCTION__.__cyg_profile_func_exit = [24 x i8] c"__cyg_profile_func_exit\00"
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.__cyg_profile_func_exit, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"%s: func = %p, called by = %p\0D\0A\00"
@__FUNCTION__.__cyg_profile_func_exit = [24 x i8] c"__cyg_profile_func_exit\00"
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.__cyg_profile_func_exit, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int cp15_accept(uint32_t anything) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cp15_accept(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ atbash(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  (void)argv;
  if (argc != 1 && argc != 2)
    usage();
  atbash(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1151 <main+0x31>
cmpl   $0x2,-0x8(%rbp)
je     1151 <main+0x31>
mov    $0x0,%al
call   1040 <usage@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <atbash@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
add    $0xfffffffd,%edi
cmp    $0xfffffffd,%edi
ja     1130 <main+0x10>
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <atbash@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @usage()
br label %14
14: ; preds = %12, %9, %2
%15 = load i32, i32* @stdin
%16 = call i32 @atbash(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add i32 %0, -3
%4 = icmp ult i32 %3, -2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @usage()
br label %7
7: ; preds = %5, %2
%8 = load i32, i32* @stdin
%9 = tail call i32 @atbash(i32 %8)
ret i32 0
}
/* Variables and functions */
char *malloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *duplicate_str(const char *s) {
  char *dup;
  if (!s)
    return NULL;
  dup = malloc(strlen(s) + 1);
  if (!dup)
    return NULL;
  return strcpy(dup, s);
}


x86 assembly (clang, -O0):
<duplicate_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <duplicate_str+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1196 <duplicate_str+0x66>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1185 <duplicate_str+0x55>
movq   $0x0,-0x8(%rbp)
jmp    1196 <duplicate_str+0x66>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplicate_str>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <duplicate_str+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <duplicate_str+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <duplicate_str+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @duplicate_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i8* @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ], [ null, %3 ]
ret i8* %11
}
void __attribute__((weak)) tim8_brk_tim12_isr() { debug_handler(__FUNCTION__); }


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

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

LLVM IR (-O0):
@__FUNCTION__.tim8_brk_tim12_isr = [19 x i8] c"tim8_brk_tim12_isr\00"
define weak void @tim8_brk_tim12_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.tim8_brk_tim12_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim8_brk_tim12_isr = [19 x i8] c"tim8_brk_tim12_isr\00"
define weak void @tim8_brk_tim12_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.tim8_brk_tim12_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cos(double);
double exp(double);
double sin(double);
void c_exp(double *aa) {
  double mag = exp(aa[0]);
  aa[0] = mag * cos(aa[1]);
  aa[1] = mag * sin(aa[1]);
}


x86 assembly (clang, -O0):
<c_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_exp>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rbx),%xmm0
call   1050 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rbx),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @c_exp(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = call double @exp(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = call double @cos(double %11)
%13 = fmul double %8, %12
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double, double* %3
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = call double @sin(double %19)
%21 = fmul double %16, %20
%22 = load double*, double** %2
%23 = getelementptr inbounds double, double* %22, i64 1
store double %21, double* %23
ret void
}

LLVM IR (-O2):
define void @c_exp(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @exp(double %2)
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @cos(double %5)
%7 = fmul double %3, %6
store double %7, double* %0
%8 = load double, double* %4
%9 = tail call double @sin(double %8)
%10 = fmul double %3, %9
store double %10, double* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PSDrawElipse();
void PSDrawFillCircle() { PSDrawElipse(); }


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

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

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

LLVM IR (-O2):
define void @PSDrawFillCircle() {
%1 = tail call i32 (...) @PSDrawElipse()
ret void
}
/* Variables and functions */
int getopt_long(int, char *const *, char const *, int /*<<< orphan*/ *,
                int /*<<< orphan*/ *);
int getopt(int argc, char *const argv[], const char *optstring) {
  return getopt_long(argc, argv, optstring, NULL, NULL);
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <getopt_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <getopt_long@plt>

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

LLVM IR (-O2):
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @getopt_long(i32 %0, i8** %1, i8* %2, i32* null, i32* null)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank4High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank4();
void m22_setParamsDXX1(uint16_t addr, uint8_t val) {
  __setCHRBank4High(addr, val);
  m22_SetChrROMBank4();
}


x86 assembly (clang, -O0):
<m22_setParamsDXX1>:
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 <__setCHRBank4High@plt>
mov    $0x0,%al
call   1040 <m22_SetChrROMBank4@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @m22_setParamsDXX1(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 @__setCHRBank4High(i32 %5, i32 %6)
%8 = call i32 (...) @m22_SetChrROMBank4()
ret void
}

LLVM IR (-O2):
define void @m22_setParamsDXX1(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank4High(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank4()
ret void
}
int init_bmp(void) {}


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

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

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

LLVM IR (-O2):
define i32 @init_bmp() {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ error_code;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
unsigned char get_XErrorEvent_error_code(void *_p) {
  return (unsigned char)((XErrorEvent *)_p)->error_code;
}


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

x86 assembly (clang, -O2):
<get_XErrorEvent_error_code>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define zeroext i8 @get_XErrorEvent_error_code(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @get_XErrorEvent_error_code(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ parse_json_array();
int /*<<< orphan*/ parse_json_array_obj();
int /*<<< orphan*/ parse_obj_array();
int main() {
  parse_obj_array();
  return 0;
  parse_json_array();
  parse_json_array_obj();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @parse_obj_array()
ret i32 0
}
R0A1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ r0 = (*((float *)11111111)); }


x86 assembly (clang, -O0):
<R0A1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac7,%eax
movss  (%rax),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @R0A1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111111 to float*)
store float %16, float* %8
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @R0A1(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int sem_init(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int semaCreate(sem_t *sem, int initialCount) {
  int rc;
  rc = sem_init(sem, 0, initialCount);
  return rc;
}


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

x86 assembly (clang, -O2):
<semaCreate>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <sem_init@plt>

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

LLVM IR (-O2):
define i32 @semaCreate(i32* %0, i32 %1) {
%3 = tail call i32 @sem_init(i32* %0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("Hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}