xunge/DecIR huggingface dataset:
double sum_transform_array(double *values, int length, double (*fn)(double)) {
  double sum = 0;
  int i = 0;
  for (i = 0; i != length; ++i) {
    sum += (*fn)(values[i]);
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_transform_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1160 <sum_transform_array+0x60>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
call   *%rax
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1129 <sum_transform_array+0x29>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_transform_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     114c <sum_transform_array+0x4c>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xorps  %xmm0,%xmm0
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%r15,%rbx,8),%xmm0
call   *%r14
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <sum_transform_array+0x20>
jmp    114f <sum_transform_array+0x4f>
xorps  %xmm0,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define double @sum_transform_array(double* nocapture %0, i32 %1, double (double)* nocapture %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %14, %7 ]
%9 = phi double [ 0.000000e+00, %5 ], [ %13, %7 ]
%10 = getelementptr inbounds double, double* %0, i64 %8
%11 = load double, double* %10
%12 = tail call double %2(double %11)
%13 = fadd double %9, %12
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %16, label %7
16: ; preds = %7, %3
%17 = phi double [ 0.000000e+00, %3 ], [ %13, %7 ]
ret double %17
}
/* Variables and functions */
int mvpstb_audio_end();
int mvpstb_video_end();
int av_empty(void) {
  int a, v;
  a = mvpstb_audio_end();
  v = mvpstb_video_end();
  if ((a == -1) || (v == -1))
    return -1;
  return a && v;
}


x86 assembly (clang, -O0):
<av_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <mvpstb_audio_end@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <mvpstb_video_end@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1150 <av_empty+0x30>
cmpl   $0xffffffff,-0xc(%rbp)
jne    115c <av_empty+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <av_empty+0x60>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1175 <av_empty+0x55>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_empty>:
push   %rbx
xor    %eax,%eax
call   1030 <mvpstb_audio_end@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <mvpstb_video_end@plt>
test   %ebx,%ebx
setne  %cl
test   %eax,%eax
setne  %dl
and    %cl,%dl
cmp    $0xffffffff,%eax
movzbl %dl,%ecx
cmovne %ecx,%eax
cmp    $0xffffffff,%ebx
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @av_empty() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @mvpstb_audio_end()
store i32 %4, i32* %2
%5 = call i32 (...) @mvpstb_video_end()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %8, %0
store i32 -1, i32* %1
br label %21
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
store i32 %20, i32* %1
br label %21
21: ; preds = %18, %11
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @av_empty() {
%1 = tail call i32 (...) @mvpstb_audio_end()
%2 = tail call i32 (...) @mvpstb_video_end()
%3 = icmp eq i32 %1, -1
%4 = icmp eq i32 %2, -1
%5 = select i1 %3, i1 true, i1 %4
%6 = icmp ne i32 %1, 0
%7 = icmp ne i32 %2, 0
%8 = select i1 %6, i1 %7, i1 false
%9 = zext i1 %8 to i32
%10 = select i1 %5, i32 -1, i32 %9
ret i32 %10
}
void XSetTransientForHint() {}


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

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

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

LLVM IR (-O2):
define void @XSetTransientForHint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ perror(char *);
void debug_stop(char **args) {
  execvp(args[0], args);
  perror("exec failed");
  _exit(0);
}


x86 assembly (clang, -O0):
<debug_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <execvp@plt>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<debug_stop>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rdi
call   1050 <execvp@plt>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"exec failed\00"
define void @debug_stop(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = call i32 @execvp(i8* %5, i8** %6)
%8 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"exec failed\00"
define void @debug_stop(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
float cosf(float);
float __glsl_cos(float angle) { return cosf(angle); }


x86 assembly (clang, -O0):
<__glsl_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_cos>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @__glsl_cos(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ workingTest();
int main() { workingTest(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @workingTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void set_blocking(int s) {
  int flags;
  flags = fcntl(s, F_GETFL);
  if (flags >= 0)
    fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115f <set_blocking+0x4f>
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1149 <set_blocking+0x39>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = load i32, i32* @O_NONBLOCK
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
%16 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %15)
br label %17
17: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = xor i32 %7, -1
%9 = and i32 %3, %8
%10 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %9)
br label %11
11: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ constPointer();
int /*<<< orphan*/ errorSample();
int /*<<< orphan*/ findMax();
int /*<<< orphan*/ pointerSample();
int /*<<< orphan*/ pointerSize();
int /*<<< orphan*/ swapMax();
int main() {
  pointerSample();
  pointerSize();
  errorSample();
  findMax();
  swapMax();
  constPointer();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <pointerSample@plt>
mov    $0x0,%al
call   1030 <pointerSize@plt>
mov    $0x0,%al
call   1070 <errorSample@plt>
mov    $0x0,%al
call   1080 <findMax@plt>
mov    $0x0,%al
call   1040 <swapMax@plt>
mov    $0x0,%al
call   1060 <constPointer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <pointerSample@plt>
xor    %eax,%eax
call   1030 <pointerSize@plt>
xor    %eax,%eax
call   1070 <errorSample@plt>
xor    %eax,%eax
call   1080 <findMax@plt>
xor    %eax,%eax
call   1040 <swapMax@plt>
xor    %eax,%eax
call   1060 <constPointer@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @pointerSample()
%3 = call i32 (...) @pointerSize()
%4 = call i32 (...) @errorSample()
%5 = call i32 (...) @findMax()
%6 = call i32 (...) @swapMax()
%7 = call i32 (...) @constPointer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pointerSample()
%2 = tail call i32 (...) @pointerSize()
%3 = tail call i32 (...) @errorSample()
%4 = tail call i32 (...) @findMax()
%5 = tail call i32 (...) @swapMax()
%6 = tail call i32 (...) @constPointer()
ret i32 0
}
void g(int *x, int y) { x[y] = 0; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movslq %esi,%rax
movl   $0x0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @g(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
store i32 0, i32* %8
ret void
}

LLVM IR (-O2):
define void @g(i32* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
store i32 0, i32* %4
ret void
}
int is_comment(char *str) {
  char *p;
  p = str;
  while (*p == ' ')
    p++;
  switch (*p) {
  case '#':
  case '[':
  case ';':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1131 <is_comment+0x31>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <is_comment+0x10>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x23,%eax
je     116b <is_comment+0x6b>
jmp    1149 <is_comment+0x49>
mov    -0x1c(%rbp),%eax
sub    $0x3b,%eax
je     116b <is_comment+0x6b>
jmp    115a <is_comment+0x5a>
mov    -0x1c(%rbp),%eax
sub    $0x5b,%eax
jne    1177 <is_comment+0x77>
jmp    116b <is_comment+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    117e <is_comment+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_comment>:
movsbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x20,%ecx
je     1100 <is_comment>
add    $0xffffffdd,%ecx
cmp    $0x38,%ecx
ja     112a <is_comment+0x2a>
mov    $0x1,%eax
movabs $0x100000001000001,%rdx
bt     %rcx,%rdx
jae    112a <is_comment+0x2a>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_comment(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
br label %6
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %19 [
i32 35, label %18
i32 91, label %18
i32 59, label %18
]
18: ; preds = %14, %14, %14
store i32 1, i32* %2
br label %20
19: ; preds = %14
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_comment(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = sext i8 %4 to i32
switch i32 %8, label %9 [
i32 35, label %10
i32 91, label %10
i32 59, label %10
]
9: ; preds = %7
br label %10
10: ; preds = %7, %7, %7, %9
%11 = phi i32 [ 0, %9 ], [ 1, %7 ], [ 1, %7 ], [ 1, %7 ]
ret i32 %11
}
/* Variables and functions */
float luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(float);
void math_rad(void) {
  float d = luaL_check_number(1);
  lua_pushnumber(d / 180. * 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<math_rad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_rad>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
cvtss2sd %xmm0,%xmm0
divsd  0xec9(%rip),%xmm0
mulsd  0xec9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_rad() {
%1 = alloca float
%2 = call float @luaL_check_number(i32 1)
store float %2, float* %1
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = fdiv double %4, 1.800000e+02
%6 = fmul double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
%8 = call i32 @lua_pushnumber(float %7)
ret void
}

LLVM IR (-O2):
define void @math_rad() {
%1 = tail call float @luaL_check_number(i32 1)
%2 = fpext float %1 to double
%3 = fdiv double %2, 1.800000e+02
%4 = fmul double %3, 0x400921FB54442D18
%5 = fptrunc double %4 to float
%6 = tail call i32 @lua_pushnumber(float %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_RESPONSE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_RESPONSE_it;
OCSP_RESPONSE *d2i_OCSP_RESPONSE(OCSP_RESPONSE **a, const unsigned char **in,
                                 long len) {
  return (OCSP_RESPONSE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                        &OCSP_RESPONSE_it);
}


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

x86 assembly (clang, -O2):
<d2i_OCSP_RESPONSE>:
mov    0x2ed9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OCSP_RESPONSE_it = global i32 0
define i32* @d2i_OCSP_RESPONSE(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OCSP_RESPONSE_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OCSP_RESPONSE_it = global i32 0
define i32* @d2i_OCSP_RESPONSE(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_RESPONSE_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void serial_init(unsigned int port, unsigned int baud) {
  *(volatile unsigned *)(port + 0x04) = 0;
  *(volatile unsigned *)(port + 0x00) = ((3));
  *(volatile unsigned *)(port + 0x04) = (1) | (1 << 3);
  *(volatile unsigned *)(port + 0x14) = baud;
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,%eax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,%eax
movl   $0x3,(%rax)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,%eax
movl   $0x9,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
lea    0x4(%rdi),%eax
movl   $0x0,(%rax)
mov    %edi,%ecx
movl   $0x3,(%rcx)
movl   $0x9,(%rax)
add    $0x14,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @serial_init(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 = add i32 %5, 4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 0, i32* %8
%9 = load i32, i32* %3
%10 = add i32 %9, 0
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 3, i32* %12
%13 = load i32, i32* %3
%14 = add i32 %13, 4
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 9, i32* %16
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = add i32 %18, 20
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %17, i32* %21
ret void
}

LLVM IR (-O2):
define void @serial_init(i32 %0, i32 %1) {
%3 = add i32 %0, 4
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 0, i32* %5
%6 = zext i32 %0 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 3, i32* %7
store volatile i32 9, i32* %5
%8 = add i32 %0, 20
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %1, i32* %10
ret void
}
void test(void) {
  int h2(int x);
  int h3(int x);
  int h4();
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
double __getU(int vid) {
  if (vid >= 0x7C)
    return 0;
  else
    return 1550 - vid * 12.5;
}


x86 assembly (clang, -O0):
<__getU>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x7c,-0xc(%rbp)
jl     111e <__getU+0x1e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <__getU+0x57>
cvtsi2sdl -0xc(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xebe(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getU>:
xorpd  %xmm0,%xmm0
cmp    $0x7c,%edi
jge    1120 <__getU+0x20>
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @__getU(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 124
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %10, double 1.250000e+01, double 1.550000e+03)
store double %11, double* %2
br label %12
12: ; preds = %7, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @__getU(i32 %0) {
%2 = icmp sgt i32 %0, 123
%3 = sitofp i32 %0 to double
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.250000e+01, double 1.550000e+03)
%6 = select i1 %2, double 0.000000e+00, double %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ DES_key_schedule;

/* Variables and functions */
int /*<<< orphan*/ DES_cbc_encrypt(void *, void *, long, int /*<<< orphan*/ *,
                                   void *, int);
void des_cbc_encrypt(void *i, void *o, long l, DES_key_schedule k, void *iv,
                     int e) {
  DES_cbc_encrypt(i, o, l, &k, iv, e);
}


x86 assembly (clang, -O0):
<des_cbc_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
lea    -0x1c(%rbp),%rcx
call   1030 <DES_cbc_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<des_cbc_encrypt>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
call   1030 <DES_cbc_encrypt@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @des_cbc_encrypt(i8* %0, i8* %1, i64 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i8*, i8** %11
%17 = load i32, i32* %12
%18 = call i32 @DES_cbc_encrypt(i8* %13, i8* %14, i64 %15, i32* %10, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @des_cbc_encrypt(i8* %0, i8* %1, i64 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
store i32 %3, i32* %7
%8 = call i32 @DES_cbc_encrypt(i8* %0, i8* %1, i64 %2, i32* %7, i8* %4, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t chitcp_ntohl(uint32_t netlong) { return ntohl(netlong); }


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

x86 assembly (clang, -O2):
<chitcp_ntohl>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @chitcp_ntohl(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Type definitions */
struct rate_conversion {
  int dummy;
};
struct callbacks {
  int dummy;
};

/* Variables and functions */
struct rate_conversion *parse_unit_internal(char const *, struct callbacks *);
void parse_unit(const char *arg, void *out, struct callbacks *cb) {
  *(const struct rate_conversion **)out = parse_unit_internal(arg, cb);
}


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

x86 assembly (clang, -O2):
<parse_unit>:
push   %rbx
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <parse_unit_internal@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.callbacks = type { i32 }
%struct.rate_conversion = type { i32 }
define void @parse_unit(i8* %0, i8* %1, %struct.callbacks* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.callbacks*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.callbacks* %2, %struct.callbacks** %6
%7 = load i8*, i8** %4
%8 = load %struct.callbacks*, %struct.callbacks** %6
%9 = call %struct.rate_conversion* @parse_unit_internal(i8* %7, %struct.callbacks* %8)
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to %struct.rate_conversion**
store %struct.rate_conversion* %9, %struct.rate_conversion** %11
ret void
}

LLVM IR (-O2):
%struct.callbacks = type { i32 }
%struct.rate_conversion = type { i32 }
define void @parse_unit(i8* %0, i8* nocapture writeonly %1, %struct.callbacks* %2) {
%4 = tail call %struct.rate_conversion* @parse_unit_internal(i8* %0, %struct.callbacks* %2)
%5 = bitcast i8* %1 to %struct.rate_conversion**
store %struct.rate_conversion* %4, %struct.rate_conversion** %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ char16_t;

/* Variables and functions */
size_t _PDCLIB_c16slen(const char16_t *str) {
  size_t n = 0;
  while (*(str++))
    n++;
  return n;
}


x86 assembly (clang, -O0):
<_PDCLIB_c16slen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
je     1139 <_PDCLIB_c16slen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_PDCLIB_c16slen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_PDCLIB_c16slen>:
cmpl   $0x0,(%rdi)
je     111f <_PDCLIB_c16slen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpl   $0x0,0x4(%rdi,%rcx,4)
mov    %rax,%rcx
jne    1110 <_PDCLIB_c16slen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @_PDCLIB_c16slen(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = add i64 %5, 1
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
int main() {
  int a = 0;
  while (1) {
    a += 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int exec(char const *, char *const *, char *const *);
int execve(const char *path, char *const argv[], char *const envp[]) {
  return exec(path, argv, envp);
}


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

x86 assembly (clang, -O2):
<execve>:
jmp    1030 <exec@plt>

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

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @exec(i8* %0, i8** %1, i8** %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xfer_log_init();
int main(int argc, char **argv) {
  printf("*** just a test ***\n");
  xfer_log_init();
  printf("*** log init ok ***\n");
  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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <xfer_log_init@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"*** just a test ***\0A\00"
@.str.1 = [21 x i8] c"*** log init ok ***\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @xfer_log_init()
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"*** just a test ***\00"
@str.2 = [20 x i8] c"*** log init ok ***\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @xfer_log_init()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int execve(const char *fname, char *const argv[], char *const envp[]) {
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 @assert(i32 0)
ret i32 -1
}

LLVM IR (-O2):
define i32 @execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 -1
}
/* Variables and functions */
scalar_t__ loadCharacter(int *, int);
int /*<<< orphan*/ putCharacter(scalar_t__);
void print(int *s) {
  int i;
  i = 0;
  while (loadCharacter(s, i) != 0) {
    putCharacter(loadCharacter(s, i));
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <loadCharacter@plt>
cmp    $0x0,%rax
je     116b <print+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <loadCharacter@plt>
mov    %rax,%rdi
call   1040 <putCharacter@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
call   1030 <loadCharacter@plt>
test   %rax,%rax
je     1156 <print+0x36>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <loadCharacter@plt>
mov    %rax,%rdi
call   1040 <putCharacter@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
jmp    1130 <print+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = call i64 @loadCharacter(i32* %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = call i64 @loadCharacter(i32* %10, i32 %11)
%13 = call i32 @putCharacter(i64 %12)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @print(i32* %0) {
%2 = tail call i64 @loadCharacter(i32* %0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i64 @loadCharacter(i32* %0, i32 %5)
%7 = tail call i32 @putCharacter(i64 %6)
%8 = add nuw nsw i32 %5, 1
%9 = tail call i64 @loadCharacter(i32* %0, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: hpav_cfg [options] interface\n"
                  "-n:	NPW passphrase\n"
                  "-d:	DPW passphrase\n"
                  "-p:	same as -n (deprecated)\n"
                  "-a:	device MAC address\n"
                  "-r:	send a device reset\n"
                  "-u:	PusbButton request\n"
                  "-k:	hash only\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [187 x i8] c"Usage: hpav_cfg [options] interface\0A-n:\09NPW passphrase\0A-d:\09DPW passphrase\0A-p:\09same as -n (deprecated)\0A-a:\09device MAC address\0A-r:\09send a device reset\0A-u:\09PusbButton request\0A-k:\09hash only\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [187 x i8] c"Usage: hpav_cfg [options] interface\0A-n:\09NPW passphrase\0A-d:\09DPW passphrase\0A-p:\09same as -n (deprecated)\0A-a:\09device MAC address\0A-r:\09send a device reset\0A-u:\09PusbButton request\0A-k:\09hash only\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
ret void
}
void rop3_56_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_56_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_56_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
or     %dl,%cl
and    %sil,%cl
mov    %edx,%eax
not    %al
and    %cl,%al
xor    %dl,%cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_56_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = or i32 %33, %39
%41 = load i8, i8* %6
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = and i32 %46, %49
%51 = or i32 %40, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
store i8 %52, i8* %53
ret void
}

LLVM IR (-O2):
define void @rop3_56_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %2
%8 = and i8 %7, %1
%9 = xor i8 %2, -1
%10 = and i8 %6, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
%15 = or i8 %14, %8
store i8 %15, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((mips16)) foo(void) { printf("in foo: mips16\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"in foo: mips16\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void cleanMyRoom(int size, char *buffer) {
  int c;
  for (c = 0; c <= size; c++) {
    buffer[c] = '\0';
  }
}


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

x86 assembly (clang, -O2):
<cleanMyRoom>:
test   %edi,%edi
js     1129 <cleanMyRoom+0x19>
push   %rax
mov    %edi,%edx
add    $0x1,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @cleanMyRoom(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = add nuw nsw i64 %5, 1
br label %7
7: ; preds = %4, %2
ret void
}
void tegra_agic_restore_registers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @tegra_agic_restore_registers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mq_unlink(char *);
int main(void) {
  mq_unlink("/abc");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"/abc\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mq_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"/abc\00"
define i32 @main() {
%1 = tail call i32 @mq_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xd0() {
  Assert_real((isupper(208) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1045, ("isupper should be 0 for 0xd0"));
}


x86 assembly (clang, -O0):
<t_isupper_0xd0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd0,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x415,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xd0>:
push   %rax
mov    $0xd0,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x415,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xd0\00"
define void @t_isupper_0xd0() {
%1 = call i64 @isupper(i32 208)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1045, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xd0\00"
define void @t_isupper_0xd0() {
%1 = tail call i64 @isupper(i32 208)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1045, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *dirname(char *);
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
char *fp_dir(const char *path) {
  char *p = strdup(path), *dir = NULL;
  if (!p)
    return NULL;
  dir = strdup(dirname(p));
  free(p);
  return dir;
}


x86 assembly (clang, -O0):
<fp_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <fp_dir+0x39>
movq   $0x0,-0x8(%rbp)
jmp    118f <fp_dir+0x5f>
mov    -0x18(%rbp),%rdi
call   1040 <dirname@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_dir>:
push   %r14
push   %rbx
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     1161 <fp_dir+0x31>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <dirname@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1163 <fp_dir+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @fp_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %4
store i8* null, i8** %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i8* null, i8** %2
br label %18
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i8* @dirname(i8* %12)
%14 = call i8* @strdup(i8* %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %5
store i8* %17, i8** %2
br label %18
18: ; preds = %11, %10
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @fp_dir(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @dirname(i8* %2)
%6 = tail call i8* @strdup(i8* %5)
%7 = tail call i32 @free(i8* %2)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %9
}