xunge/DecIR huggingface dataset:
void crypto_alloc_tfm(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<crypto_alloc_tfm>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_alloc_tfm>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.crypto_alloc_tfm = [17 x i8] c"crypto_alloc_tfm\00"
define void @crypto_alloc_tfm() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.crypto_alloc_tfm, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.crypto_alloc_tfm = [17 x i8] c"crypto_alloc_tfm\00"
define void @crypto_alloc_tfm() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.crypto_alloc_tfm, i64 0, i64 0))
ret void
}
int corner_ori(int cubieval) { return cubieval >> 3; }


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

x86 assembly (clang, -O2):
<corner_ori>:
mov    %edi,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @corner_ori(i32 %0) {
%2 = ashr i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _start();
void main() { _start(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @_start()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  int unuesd;
  printf("紫夜阑珊, 青伶巷草\n");
  printf("落花美眷, 似水流年\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"\E7\B4\AB\E5\A4\9C\E9\98\91\E7\8F\8A, \E9\9D\92\E4\BC\B6\E5\B7\B7\E8\8D\89\0A\00"
@.str.1 = [28 x i8] c"\E8\90\BD\E8\8A\B1\E7\BE\8E\E7\9C\B7, \E4\BC\BC\E6\B0\B4\E6\B5\81\E5\B9\B4\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [27 x i8] c"\E7\B4\AB\E5\A4\9C\E9\98\91\E7\8F\8A, \E9\9D\92\E4\BC\B6\E5\B7\B7\E8\8D\89\00"
@str.2 = [27 x i8] c"\E8\90\BD\E8\8A\B1\E7\BE\8E\E7\9C\B7, \E4\BC\BC\E6\B0\B4\E6\B5\81\E5\B9\B4\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
double dist(int, int, int, double, double, double);
double magnitude(double v[3]) { return dist(0., 0., 0., v[0], v[1], v[2]); }


x86 assembly (clang, -O0):
<magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <dist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magnitude>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <dist@plt>

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

LLVM IR (-O2):
define double @magnitude(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call double @dist(i32 0, i32 0, i32 0, double %2, double %4, double %6)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ evt_reset();
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ trace_read_reset();
void trc_calibrate_reset(FILE *f) {
  fseek(f, 0, SEEK_SET);
  evt_reset();
  trace_read_reset();
}


x86 assembly (clang, -O0):
<trc_calibrate_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <fseek@plt>
mov    $0x0,%al
call   1040 <evt_reset@plt>
mov    $0x0,%al
call   1050 <trace_read_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trc_calibrate_reset>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <fseek@plt>
xor    %eax,%eax
call   1040 <evt_reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <trace_read_reset@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @trc_calibrate_reset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i32 0, i32 %4)
%6 = call i32 (...) @evt_reset()
%7 = call i32 (...) @trace_read_reset()
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @trc_calibrate_reset(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 (...) @evt_reset()
%5 = tail call i32 (...) @trace_read_reset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int setsockopt(int, int, int, void const *, int /*<<< orphan*/);
int setsockopt_portable(int s, int level, int optname, const void *optval,
                        socklen_t optlen) {
  return setsockopt(s, level, optname, optval, optlen);
}


x86 assembly (clang, -O0):
<setsockopt_portable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsockopt_portable>:
jmp    1030 <setsockopt@plt>

LLVM IR (-O0):
define i32 @setsockopt_portable(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @setsockopt(i32 %11, i32 %12, i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @setsockopt_portable(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glGetClipPlane(int /*<<< orphan*/, int /*<<< orphan*/ *);
void GetClipPlane(GLenum plane, GLdouble *equation) {
  glGetClipPlane(plane, equation);
}


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

x86 assembly (clang, -O2):
<GetClipPlane>:
jmp    1030 <glGetClipPlane@plt>

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

LLVM IR (-O2):
define void @GetClipPlane(i32 %0, i32* %1) {
%3 = tail call i32 @glGetClipPlane(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool streq(const char *left, const char *right) {
  return 0 == strcmp(left, right);
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int N1, N2;
  N1 = 2;
  N2 = 3;
  printf("\n N1 = %d", N1);
  printf("\n N2 = %d", N2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"\0A N1 = %d\00"
@.str.1 = [10 x i8] c"\0A N2 = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_CONTINUE;
scalar_t__ ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoContinue(int fd) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_CONTINUE) < 0)) {
    perror("VIDEO CONTINUE: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoContinue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0xc(%rbp)
test   $0x1,%al
jne    115b <videoContinue+0x3b>
jmp    1173 <videoContinue+0x53>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <videoContinue+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoContinue>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113b <videoContinue+0x1b>
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_CONTINUE = global i32 0
@.str = [17 x i8] c"VIDEO CONTINUE: \00"
define i32 @videoContinue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @VIDEO_CONTINUE
%7 = call i64 @ioctl(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
br i1 %8, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@VIDEO_CONTINUE = global i32 0
@.str = [17 x i8] c"VIDEO CONTINUE: \00"
define i32 @videoContinue(i32 %0) {
%2 = load i32, i32* @VIDEO_CONTINUE
%3 = tail call i64 @ioctl(i32 %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
void XFillRectangles() {}


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

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

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

LLVM IR (-O2):
define void @XFillRectangles() {
ret void
}
/* Variables and functions */
int f2u(float);
scalar_t__ isnan(float);
float u2f(unsigned int);
unsigned test_float_twice(unsigned uf) {
  float f = u2f(uf);
  float tf = 2 * f;
  if (isnan(f))
    return uf;
  else
    return f2u(tf);
}


x86 assembly (clang, -O0):
<test_float_twice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <u2f@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xeb0(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     1179 <test_float_twice+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <test_float_twice+0x56>
movss  -0x10(%rbp),%xmm0
call   1050 <f2u@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float_twice>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1030 <u2f@plt>
movss  %xmm0,0xc(%rsp)
call   1040 <isnan@plt>
test   %rax,%rax
je     1154 <test_float_twice+0x24>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
movss  0xc(%rsp),%xmm0
addss  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1050 <f2u@plt>

LLVM IR (-O0):
define i32 @test_float_twice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call float @u2f(i32 %6)
store float %7, float* %4
%8 = load float, float* %4
%9 = fmul float 2.000000e+00, %8
store float %9, float* %5
%10 = load float, float* %4
%11 = call i64 @isnan(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %18
15: ; preds = %1
%16 = load float, float* %5
%17 = call i32 @f2u(float %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_float_twice(i32 %0) {
%2 = tail call float @u2f(i32 %0)
%3 = tail call i64 @isnan(float %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = fmul float %2, 2.000000e+00
%7 = tail call i32 @f2u(float %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ %0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ allot_float(int /*<<< orphan*/);
int /*<<< orphan*/ bignum_to_float(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
void primitive_bignum_to_float_impl(void) {
  drepl(allot_float(bignum_to_float(dpeek())));
}


x86 assembly (clang, -O0):
<primitive_bignum_to_float_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <bignum_to_float@plt>
mov    %eax,%edi
call   1060 <allot_float@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_bignum_to_float_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <bignum_to_float@plt>
mov    %eax,%edi
call   1060 <allot_float@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_bignum_to_float_impl() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @bignum_to_float(i32 %1)
%3 = call i32 @allot_float(i32 %2)
%4 = call i32 @drepl(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_bignum_to_float_impl() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @bignum_to_float(i32 %1)
%3 = tail call i32 @allot_float(i32 %2)
%4 = tail call i32 @drepl(i32 %3)
ret void
}
int main(int argc, char **argv) {
  int __attribute__((unit(m))) x;
  double y = argc == 2 ? 0 : x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1126 <main+0x26>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    112c <main+0x2c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
br label %13
11: ; preds = %2
%12 = load i32, i32* %6
br label %13
13: ; preds = %11, %10
%14 = phi i32 [ 0, %10 ], [ %12, %11 ]
%15 = sitofp i32 %14 to double
store double %15, double* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int stindex(char *, char *);
char *substr(char *s, char *t) {
  static int i;
  if ((i = stindex(s, t)) != -1)
    return s + i;
  else
    return NULL;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <stindex@plt>
mov    %eax,0x2ef9(%rip)
cmp    $0xffffffff,%eax
je     1153 <substr+0x43>
mov    -0x10(%rbp),%rax
movslq 0x2ee5(%rip),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115b <substr+0x4b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <stindex@plt>
movslq %eax,%rcx
add    %rcx,%rbx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
cmovne %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @substr(i8* %0, i8* %1) {
%3 = tail call i32 @stindex(i8* %0, i8* %1)
%4 = icmp eq i32 %3, -1
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = select i1 %4, i8* null, i8* %6
ret i8* %7
}
int jpeg_parse_sos(unsigned char *start, struct jpeg_frame *p_jframe) {
  int len = (int)start[0] << 8 | start[1];
  return len;
}


x86 assembly (clang, -O0):
<jpeg_parse_sos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jpeg_parse_sos>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
%struct.jpeg_frame = type opaque
define i32 @jpeg_parse_sos(i8* %0, %struct.jpeg_frame* %1) {
%3 = alloca i8*
%4 = alloca %struct.jpeg_frame*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.jpeg_frame* %1, %struct.jpeg_frame** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %10, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
%struct.jpeg_frame = type opaque
define i32 @jpeg_parse_sos(i8* nocapture %0, %struct.jpeg_frame* nocapture readnone %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}
unsigned int VXD_GETEBX(void) {
  register unsigned int r asm("ebx");
  return r;
}


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

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

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

LLVM IR (-O2):
define i32 @VXD_GETEBX() {
ret i32 undef
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR57_set(void) { return U_WMRCORENONE_set("U_WMR57"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR57\00"
define i8* @U_WMR57_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR57\00"
define i8* @U_WMR57_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
float fmaf(float, float, float);
float futrts_fma32(float a, float b, float c) { return fmaf(a, b, c); }


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

x86 assembly (clang, -O2):
<futrts_fma32>:
jmp    1030 <fmaf@plt>

LLVM IR (-O0):
define float @futrts_fma32(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fma.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @futrts_fma32(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
double altitude_to_pressure(double);
double altitude_to_temperature(double);
double altitude_to_air_density(double altitude) {
  return altitude_to_pressure(altitude) /
         (8.314472 / 0.0289644 * altitude_to_temperature(altitude));
}


x86 assembly (clang, -O0):
<altitude_to_air_density>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <altitude_to_pressure@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <altitude_to_temperature@plt>
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<altitude_to_air_density>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <altitude_to_pressure@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <altitude_to_temperature@plt>
mulsd  0xeb8(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @altitude_to_air_density(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @altitude_to_pressure(double %3)
%5 = load double, double* %2
%6 = call double @altitude_to_temperature(double %5)
%7 = fmul double 0x4071F0EEE0D08093, %6
%8 = fdiv double %4, %7
ret double %8
}

LLVM IR (-O2):
define double @altitude_to_air_density(double %0) {
%2 = tail call double @altitude_to_pressure(double %0)
%3 = tail call double @altitude_to_temperature(double %0)
%4 = fmul double %3, 0x4071F0EEE0D08093
%5 = fdiv double %2, %4
ret double %5
}
void f0(int i, ...) {}


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

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

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

LLVM IR (-O2):
define void @f0(i32 %0, ...) {
ret void
}
int XFetchName() {}


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

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

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

LLVM IR (-O2):
define i32 @XFetchName() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void _M2_deviceIf_init(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {
  Init();
}


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

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

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

LLVM IR (-O2):
define void @_M2_deviceIf_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
ret void
}
/* Variables and functions */
scalar_t__ json_isdigit(int);
int json_isxdigit(int ch) {
  return json_isdigit(ch) || (ch >= 'a' && ch <= 'f') ||
         (ch >= 'A' && ch <= 'F');
}


x86 assembly (clang, -O0):
<json_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <json_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <json_isxdigit+0x5d>
cmpl   $0x61,-0x4(%rbp)
jl     114e <json_isxdigit+0x3e>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116d <json_isxdigit+0x5d>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1167 <json_isxdigit+0x57>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <json_isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @json_isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @json_isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 97
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 102
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 70
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @json_isxdigit(i32 %0) {
%2 = tail call i64 @json_isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const, double const);
void glmPrintVector2d(const double v[2]) { printf("[%f,%f]", v[0], v[1]); }


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

x86 assembly (clang, -O2):
<glmPrintVector2d>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"[%f,%f]\00"
define void @glmPrintVector2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %2, double %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char *);
char *strcat(char *dest, const char *src) {
  char *ret = dest;
  dest += strlen(dest);
  strcpy(dest, src);
  return ret;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %3
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void endian_copy(void *dest, const void *src, size_t destsize, size_t srcsize) {
  memcpy(dest, src, srcsize);
}


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

x86 assembly (clang, -O2):
<endian_copy>:
mov    %rcx,%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @endian_copy(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %8
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
ret void
}

LLVM IR (-O2):
define void @endian_copy(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %3)
ret void
}
int test_long() {
  int i;
  long sums[2] = {0};
#pragma acc parallel loop
  for (i = 0; i < 8192; i++) {
#pragma acc atomic
    sums[0]++;
#pragma acc atomic
    ++sums[1];
  }
  for (i = 0; i < 2; i++) {
    if (sums[i] != (8192)) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2000,-0x8(%rbp)
jge    1162 <test_long+0x52>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <test_long+0x1f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a7 <test_long+0x97>
movslq -0x8(%rbp),%rax
cmpq   $0x2000,-0x20(%rbp,%rax,8)
je     1194 <test_long+0x84>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ae <test_long+0x9e>
jmp    1199 <test_long+0x89>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <test_long+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_long() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 8192
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%10 = load i64, i64* %9
%11 = add nsw i64 %10, 1
store i64 %11, i64* %9
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%13 = load i64, i64* %12
%14 = add nsw i64 %13, 1
store i64 %14, i64* %12
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %5
18: ; preds = %5
store i32 0, i32* %2
br label %19
19: ; preds = %32, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 %24
%26 = load i64, i64* %25
%27 = icmp ne i64 %26, 8192
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %36
31: ; preds = %22
br label %32
32: ; preds = %31
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %19
35: ; preds = %19
store i32 0, i32* %1
br label %36
36: ; preds = %35, %28
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
define i32 @test_long() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ USB_ReInitComponent();
void USB_BUS_RESET_ISR(void) {
  do {
  } while (0);
  USB_ReInitComponent();
}


x86 assembly (clang, -O0):
<USB_BUS_RESET_ISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <USB_BUS_RESET_ISR+0x9>
jmp    111e <USB_BUS_RESET_ISR+0xe>
mov    $0x0,%al
call   1030 <USB_ReInitComponent@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @USB_BUS_RESET_ISR() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
%3 = call i32 (...) @USB_ReInitComponent()
ret void
}

LLVM IR (-O2):
define void @USB_BUS_RESET_ISR() {
%1 = tail call i32 (...) @USB_ReInitComponent()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_version(void) {
  printf("%s"
         "\n",
         "ebr_editor-2013.07.04, sk4zuzu@gmail.com");
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [41 x i8] c"ebr_editor-2013.07.04, sk4zuzu@gmail.com\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [41 x i8] c"ebr_editor-2013.07.04, sk4zuzu@gmail.com\00"
define void @show_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *prog) {
  printf("usage: %s [-h] [-t]\n", prog);
  printf("-t\t\tset global timer\n");
  printf("-h \t\t\thelp\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"usage: %s [-h] [-t]\0A\00"
@.str.1 = [22 x i8] c"-t\09\09set global timer\0A\00"
@.str.2 = [12 x i8] c"-h \09\09\09help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage: %s [-h] [-t]\0A\00"
@str = [21 x i8] c"-t\09\09set global timer\00"
@str.3 = [11 x i8] c"-h \09\09\09help\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void efgets(char *s, int size, FILE *f) {
  if (NULL != fgets(s, size, f))
    return;
  fprintf(stderr, "fail to read string\n");
  exit(2);
}


x86 assembly (clang, -O0):
<efgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1167 <efgets+0x37>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<efgets>:
push   %rax
call   1030 <fgets@plt>
test   %rax,%rax
je     113d <efgets+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"fail to read string\0A\00"
define void @efgets(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp ne i32* null, %10
br i1 %11, label %12, label %13
12: ; preds = %3
ret void
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"fail to read string\0A\00"
define void @efgets(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
ret void
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
short file___NativeString_file_mkdir___impl(char *);
short int core__file___NativeString___file_mkdir(char *self) {
  short int var;
  short int var1;
  var1 = file___NativeString_file_mkdir___impl(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core__file___NativeString___file_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <file___NativeString_file_mkdir___impl@plt>
mov    %ax,-0xc(%rbp)
mov    -0xc(%rbp),%ax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core__file___NativeString___file_mkdir>:
jmp    1030 <file___NativeString_file_mkdir___impl@plt>

LLVM IR (-O0):
define signext i16 @core__file___NativeString___file_mkdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i16
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call signext i16 @file___NativeString_file_mkdir___impl(i8* %5)
store i16 %6, i16* %4
%7 = load i16, i16* %4
store i16 %7, i16* %3
br label %8
8: ; preds = %1
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @core__file___NativeString___file_mkdir(i8* %0) {
%2 = tail call signext i16 @file___NativeString_file_mkdir___impl(i8* %0)
ret i16 %2
}
float __attribute__((const)) lw6mat_dtof(double d) { return (float)d; }


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

x86 assembly (clang, -O2):
<lw6mat_dtof>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @lw6mat_dtof(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @lw6mat_dtof(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
int return_zero() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @return_zero() {
ret i32 0
}
int test_imm_19int16_reg(short val) {
  return ((val) & (-0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffe7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_19int16_reg>:
test   $0xffe7,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_19int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -25
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_19int16_reg(i16 signext %0) {
%2 = and i16 %0, -25
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTSocketWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSocketWrite() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int is_dir(const char *path) {
  struct stat buf;
  int err;
  err = stat(path, &buf);
  if (-1 == err) {
    return 0;
  }
  return S_ISDIR(buf.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x1c(%rbp)
mov    $0xffffffff,%eax
cmp    -0x1c(%rbp),%eax
jne    1156 <is_dir+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_dir+0x41>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <is_dir+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @S_ISDIR(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}