xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dumpByte(char const);
int /*<<< orphan*/ dumpShort(unsigned short);
unsigned short strlen(char const *);
void dumpName(const char *name) {
  int count;
  unsigned short length = strlen(name);
  dumpShort(length);
  for (count = 0; count < length; count++) {
    dumpByte(name[count]);
  }
}


x86 assembly (clang, -O0):
<dumpName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %ax,-0xe(%rbp)
movzwl -0xe(%rbp),%edi
call   1030 <dumpShort@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzwl -0xe(%rbp),%ecx
cmp    %ecx,%eax
jge    1187 <dumpName+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <dumpByte@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <dumpName+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpName>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
movzwl %ax,%r15d
mov    %r15d,%edi
call   1030 <dumpShort@plt>
test   %r15w,%r15w
je     1173 <dumpName+0x43>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1050 <dumpByte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1160 <dumpName+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dumpName(i8* %0) {
%2 = tail call zeroext i16 @strlen(i8* %0)
%3 = tail call i32 @dumpShort(i16 zeroext %2)
%4 = icmp eq i16 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = zext i16 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @dumpByte(i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret void
}
void free_strv(char *strv[]) {
  if (!strv)
    return;
  for (int i = 0; strv[i]; i++) {
    free(strv[i]);
  }
  free(strv);
}


x86 assembly (clang, -O0):
<free_strv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_strv+0x1c>
jmp    116e <free_strv+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <free_strv+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <free_strv+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_strv>:
test   %rdi,%rdi
je     1150 <free_strv+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_strv+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_strv+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_strv(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %8, %3
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
br label %15
8: ; preds = %3, %8
%9 = phi i64 [ %11, %8 ], [ 0, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %9, 1
%12 = getelementptr inbounds i8*, i8** %0, i64 %11
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %6, label %8
15: ; preds = %1, %6
ret void
}
/* Variables and functions */
char *dlerror();
int /*<<< orphan*/ dlsym(void *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void bind_hook(void *h, const char *name) {
  if (!dlsym(h, name))
    fprintf(stderr, "glgrab: failed to bind %s hook: %s\n", name, dlerror());
}


x86 assembly (clang, -O0):
<bind_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <dlsym@plt>
cmp    $0x0,%eax
jne    1187 <bind_hook+0x57>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7e(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_hook>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1050 <dlsym@plt>
test   %eax,%eax
je     1146 <bind_hook+0x16>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xea3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"glgrab: failed to bind %s hook: %s\0A\00"
define void @bind_hook(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @dlsym(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = call i8* (...) @dlerror()
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
br label %14
14: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"glgrab: failed to bind %s hook: %s\0A\00"
define void @bind_hook(i8* %0, i8* %1) {
%3 = tail call i32 @dlsym(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i8* (...) @dlerror()
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %7)
br label %9
9: ; preds = %5, %2
ret void
}
char *return_line() { return ("\n===================================="); }


x86 assembly (clang, -O0):
<return_line>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_line>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0A====================================\00"
define i8* @return_line() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0A====================================\00"
define i8* @return_line() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ group_part(int);
scalar_t__ is_group_part();
void group(int skip) {
  group_part(skip);
  while (is_group_part())
    group_part(skip);
}


x86 assembly (clang, -O0):
<group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <group_part@plt>
mov    $0x0,%al
call   1040 <is_group_part@plt>
cmp    $0x0,%rax
je     1151 <group+0x31>
mov    -0x4(%rbp),%edi
call   1030 <group_part@plt>
jmp    1133 <group+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<group>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <group_part@plt>
xor    %eax,%eax
call   1040 <is_group_part@plt>
test   %rax,%rax
je     1145 <group+0x25>
mov    %ebx,%edi
jmp    1130 <group+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @group(i32 %0) {
%2 = tail call i32 @group_part(i32 %0)
%3 = tail call i64 (...) @is_group_part()
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = tail call i32 @group_part(i32 %0)
%7 = tail call i64 (...) @is_group_part()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
void U_EMRSETMETARGN_swap(char *record, int torev) {
  core5_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_EMRSETMETARGN_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret void
}
int iround(double x) {
  if (x < 0.0) {
    return (int)(x - 0.5);
  } else {
    return (int)(x + 0.5);
  }
}


x86 assembly (clang, -O0):
<iround>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1134 <iround+0x34>
movsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <iround+0x48>
movsd  0xec4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iround>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @iround(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fsub double %7, 5.000000e-01
%9 = fptosi double %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fadd double %11, 5.000000e-01
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @iround(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
float q_sqrt(float number) {
  long i;
  float x2, y;
  const float threehalfs = 1.5F;
  x2 = number * 0.5F;
  y = number;
  i = *(long *)&y;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (threehalfs - (x2 * y * y));
  y = y * (threehalfs - (x2 * y * y));
  return y;
}


x86 assembly (clang, -O0):
<q_sqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f3759df,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe7b(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe41(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @q_sqrt(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
store float %9, float* %5
%10 = bitcast float* %5 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = ashr i64 %12, 1
%14 = sub nsw i64 1597463007, %13
store i64 %14, i64* %3
%15 = bitcast i64* %3 to float*
%16 = load float, float* %15
store float %16, float* %5
%17 = load float, float* %5
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = load float, float* %5
%22 = fneg float %20
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %17, %23
store float %24, float* %5
%25 = load float, float* %5
%26 = load float, float* %4
%27 = load float, float* %5
%28 = fmul float %26, %27
%29 = load float, float* %5
%30 = fneg float %28
%31 = call float @llvm.fmuladd.f32(float %30, float %29, float 1.500000e+00)
%32 = fmul float %25, %31
store float %32, float* %5
%33 = load float, float* %5
ret float %33
}

LLVM IR (-O2):
define float @q_sqrt(float %0) {
ret float poison
}
void proc41() {}


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

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

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

LLVM IR (-O2):
define void @proc41() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void buffer_assert(int value) {
  if (!value)
    abort();
}


x86 assembly (clang, -O0):
<buffer_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <buffer_assert+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_assert>:
test   %edi,%edi
je     1115 <buffer_assert+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @buffer_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @buffer_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
void rt_exit(void *fixture) {}


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

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

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

LLVM IR (-O2):
define void @rt_exit(i8* nocapture %0) {
ret void
}
long rfact(long n) {
  long result;
  if (n <= 1) {
    result = 1;
  } else {
    result = n * rfact(n - 1);
  }
  return result;
}


x86 assembly (clang, -O0):
<rfact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jg     1134 <rfact+0x24>
movq   $0x1,-0x10(%rbp)
jmp    1158 <rfact+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <rfact@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfact>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1121 <rfact+0x21>
mov    $0x1,%eax
imul   %rdi,%rax
lea    -0x1(%rdi),%rcx
cmp    $0x2,%rdi
mov    %rcx,%rdi
ja     1110 <rfact+0x10>
ret

LLVM IR (-O0):
define i64 @rfact(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp sle i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %3
br label %13
7: ; preds = %1
%8 = load i64, i64* %2
%9 = load i64, i64* %2
%10 = sub nsw i64 %9, 1
%11 = call i64 @rfact(i64 %10)
%12 = mul nsw i64 %8, %11
store i64 %12, i64* %3
br label %13
13: ; preds = %7, %6
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @rfact(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = add nsw i64 %4, -1
%7 = mul nsw i64 %4, %5
%8 = icmp ult i64 %4, 3
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ errno;
int /*<<< orphan*/ printf(char *);
int fcntl_test(int fd, int cmd, ...) {
  int ret, save_errno;
  va_list ap;
  int arg;
  switch (cmd) {
  default:
    printf("\tFailed Phase 1: Unknown fcntl command, "
           "returning failure with EINVAL\n");
    errno = EINVAL;
    return -1;
  }
  errno = 0;
  return -1;
}


x86 assembly (clang, -O0):
<fcntl_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%rcx
mov    0x2ea5(%rip),%rax
mov    %rcx,(%rax)
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl_test>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%rax
mov    0x2eb2(%rip),%rcx
mov    %rax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [71 x i8] c"\09Failed Phase 1: Unknown fcntl command, returning failure with EINVAL\0A\00"
@EINVAL = global i64 0
@errno = global i64 0
define i32 @fcntl_test(i32 %0, i32 %1, ...) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
switch i32 %9, label %10 [
]
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%12 = load i64, i64* @EINVAL
store i64 %12, i64* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i64 0
@errno = global i64 0
@str = [70 x i8] c"\09Failed Phase 1: Unknown fcntl command, returning failure with EINVAL\00"
define i32 @fcntl_test(i32 %0, i32 %1, ...) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%4 = load i64, i64* @EINVAL
store i64 %4, i64* @errno
ret i32 -1
}
char *getenv(const char *name __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @getenv(i8* nocapture readnone %0) {
ret i8* null
}
void init_nls() {}


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

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

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

LLVM IR (-O2):
define void @init_nls() {
ret void
}
__typeof__(stpncpy(1, 1, "")) test_stpncpy_141(void) {
  return stpncpy(1, 1, "");
}


x86 assembly (clang, -O0):
<test_stpncpy_141>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
lea    0xee0(%rip),%rdx
mov    %rsi,%rdi
call   1030 <stpncpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stpncpy_141>:
lea    0xee9(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <stpncpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_stpncpy_141() {
%1 = call i8* @stpncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @test_stpncpy_141() {
%1 = tail call i8* @stpncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}
void show_command(char show_c) {
  if (show_c == 'w') {
  }
  if (show_c == 'e') {
  }
  if (show_c == 'c') {
  }
}


x86 assembly (clang, -O0):
<show_command>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x77,%eax
jne    111c <show_command+0x1c>
jmp    111c <show_command+0x1c>
movsbl -0x1(%rbp),%eax
cmp    $0x65,%eax
jne    112e <show_command+0x2e>
jmp    112e <show_command+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x63,%eax
jne    1140 <show_command+0x40>
jmp    1140 <show_command+0x40>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @show_command(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 119
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 101
br i1 %10, label %11, label %12
11: ; preds = %7
br label %12
12: ; preds = %11, %7
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 99
br i1 %15, label %16, label %17
16: ; preds = %12
br label %17
17: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
define void @show_command(i8 signext %0) {
ret void
}
double it_pol_neville_s2(double *f, double alpha) {
  return (alpha * f[1] - (alpha - 1) * f[0]);
}


x86 assembly (clang, -O0):
<it_pol_neville_s2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
movsd  0xed8(%rip),%xmm3
subsd  %xmm3,%xmm1
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<it_pol_neville_s2>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  (%rdi),%xmm1
mulsd  0x8(%rdi),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @it_pol_neville_s2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double, double* %4
%10 = fsub double %9, 1.000000e+00
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = fmul double %10, %13
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
ret double %16
}

LLVM IR (-O2):
define double @it_pol_neville_s2(double* nocapture %0, double %1) {
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fadd double %1, -1.000000e+00
%6 = load double, double* %0
%7 = fneg double %5
%8 = fmul double %6, %7
%9 = tail call double @llvm.fmuladd.f64(double %1, double %4, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ handle_POLL(int /*<<< orphan*/);
int gen_POLL() {
  handle_POLL(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_POLL>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_POLL@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_POLL() {
%1 = call i32 @handle_POLL(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_POLL() {
%1 = tail call i32 @handle_POLL(i32 0)
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double pythagoras(double x, double y) { return sqrt((x * x) + (y * y)); }


x86 assembly (clang, -O0):
<pythagoras>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pythagoras>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <pythagoras+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @pythagoras(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @pythagoras(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
usage(void) {
  puts("--Reboot--\n\n"
       "        Play with reboot syscall\n\n"
       "Options:\n\n"
       " -h|--help		Display help\n"
       " -1|--cad-off	        Control Alt Delete off\n"
       " -2|--cad-on	        Control Alt Delete on\n"
       " -3|--halt	        Halt\n"
       " -4|--kexec	        Execute loaded earlier (kexec_load)\n"
       " -5|--power-off	        Power off\n"
       " -6|--restart	        Restart\n"
       " -7|--restart2	        Restart 2\n"
       " -8|--sw-suspend	Suspend to disk (hibernate)\n"
       "More info: reboot(2), linux/include/uapi/linux/reboot.h");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [447 x i8] c"--Reboot--\0A\0A Play with reboot syscall\0A\0AOptions:\0A\0A -h|--help\09\09Display help\0A -1|--cad-off\09 Control Alt Delete off\0A -2|--cad-on\09 Control Alt Delete on\0A -3|--halt\09 Halt\0A -4|--kexec\09 Execute loaded earlier (kexec_load)\0A -5|--power-off\09 Power off\0A -6|--restart\09 Restart\0A -7|--restart2\09 Restart 2\0A -8|--sw-suspend\09Suspend to disk (hibernate)\0AMore info: reboot(2), linux/include/uapi/linux/reboot.h\00"
define i32 @usage() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([447 x i8], [447 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [447 x i8] c"--Reboot--\0A\0A Play with reboot syscall\0A\0AOptions:\0A\0A -h|--help\09\09Display help\0A -1|--cad-off\09 Control Alt Delete off\0A -2|--cad-on\09 Control Alt Delete on\0A -3|--halt\09 Halt\0A -4|--kexec\09 Execute loaded earlier (kexec_load)\0A -5|--power-off\09 Power off\0A -6|--restart\09 Restart\0A -7|--restart2\09 Restart 2\0A -8|--sw-suspend\09Suspend to disk (hibernate)\0AMore info: reboot(2), linux/include/uapi/linux/reboot.h\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([447 x i8], [447 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct timeval *);
struct timeval *Selective_KillTime(struct timeval *t) {
  free(t);
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define %struct.timeval* @Selective_KillTime(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @free(%struct.timeval* %3)
ret %struct.timeval* null
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define noalias %struct.timeval* @Selective_KillTime(%struct.timeval* nocapture %0) {
%2 = tail call i32 @free(%struct.timeval* %0)
ret %struct.timeval* null
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1, "World\n", 6);
  lseek(1, 0, SEEK_SET);
  write(1, "Hello\n", 6);
  lseek(1, 0, SEEK_END);
  write(1, "World\n", 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <lseek@plt>
mov    $0x1,%edi
lea    0xea1(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <lseek@plt>
mov    $0x1,%edi
lea    0xe6f(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <lseek@plt>
lea    0xeb1(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1030 <write@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <lseek@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"World\0A\00"
@SEEK_SET = global i32 0
@.str.1 = [7 x i8] c"Hello\0A\00"
@SEEK_END = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = load i32, i32* @SEEK_SET
%4 = call i32 @lseek(i32 1, i32 0, i32 %3)
%5 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%6 = load i32, i32* @SEEK_END
%7 = call i32 @lseek(i32 1, i32 0, i32 %6)
%8 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"World\0A\00"
@SEEK_SET = global i32 0
@.str.1 = [7 x i8] c"Hello\0A\00"
@SEEK_END = global i32 0
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @lseek(i32 1, i32 0, i32 %2)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%5 = load i32, i32* @SEEK_END
%6 = tail call i32 @lseek(i32 1, i32 0, i32 %5)
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
char *xmemdup(char const *, size_t, size_t);
char *op_xstrndup(char const *s, size_t len) {
  return xmemdup(s, len, len + 1);
}


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

x86 assembly (clang, -O2):
<op_xstrndup>:
lea    0x1(%rsi),%rdx
jmp    1030 <xmemdup@plt>

LLVM IR (-O0):
define i8* @op_xstrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i8* @xmemdup(i8* %5, i64 %6, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @op_xstrndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @xmemdup(i8* %0, i64 %1, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void losequote(char *str) {
  char tmp[128];
  if (*str == '"') {
    strcpy(tmp, str + 1);
    strcpy(str, tmp);
  }
}


x86 assembly (clang, -O0):
<losequote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1153 <losequote+0x43>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<losequote>:
push   %r14
push   %rbx
sub    $0x88,%rsp
cmpb   $0x22,(%rdi)
jne    113c <losequote+0x2c>
mov    %rdi,%rbx
lea    0x1(%rdi),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @losequote(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 34
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = call i32 @strcpy(i8* %9, i8* %11)
%13 = load i8*, i8** %2
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%15 = call i32 @strcpy(i8* %13, i8* %14)
br label %16
16: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @losequote(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 34
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = call i32 @strcpy(i8* %3, i8* %7)
%9 = call i32 @strcpy(i8* %0, i8* %3)
br label %10
10: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int err = 0, err2 = 0;
  error(err);
  printf("This is"
         "ver 0");
  error(err2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"This isver 0\00"
define i32 @main() {
%1 = tail call i32 @error(i32 0)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @error(i32 0)
ret i32 0
}
int tolower(int c) {
  if (c >= 0x41 && c <= 0x5A)
    c = c + 0x20;
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x0f() {
  Assert_real((isspace(15) == 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_isspace.c",
              80, ("isspace should be 0 for 0x0f"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x0f>:
push   %rax
mov    $0xf,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x50,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x0f\00"
define void @t_isspace_0x0f() {
%1 = call i64 @isspace(i32 15)
%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 80, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x0f\00"
define void @t_isspace_0x0f() {
%1 = tail call i64 @isspace(i32 15)
%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 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float psi2kpa(float psi) { return psi * 6.89475729f; }


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

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

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

LLVM IR (-O2):
define float @psi2kpa(float %0) {
%2 = fmul float %0, 0x401B943B40000000
ret float %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
void substract(char *arg1, char *arg2) {
  int a, b;
  a = atoi(arg1);
  b = atoi(arg2);
  printf("%d\n", a - b);
}


x86 assembly (clang, -O0):
<substract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
sub    -0x18(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substract>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atoi@plt>
sub    %eax,%ebp
lea    0xec2(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @substract(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @atoi(i8* %1)
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void selinux_secmark_refcount_dec(void) { return; }


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

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

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

LLVM IR (-O2):
define void @selinux_secmark_refcount_dec() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int sig) { printf("test prog received signal %d\n", sig); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [30 x i8] c"test prog received signal %d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
float max2(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max2+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max2+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @max2(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int crypto_scalarmult_curve25519_base(unsigned char *, unsigned char *);
int /*<<< orphan*/ randombytes(unsigned char *, int);
int crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk,
                                                  unsigned char *sk) {
  randombytes(sk, 32);
  return crypto_scalarmult_curve25519_base(pk, sk);
}


x86 assembly (clang, -O0):
<crypto_box_curve25519xsalsa20poly1305_keypair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <randombytes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <crypto_scalarmult_curve25519_base@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_box_curve25519xsalsa20poly1305_keypair>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x20,%esi
call   1030 <randombytes@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <crypto_scalarmult_curve25519_base@plt>

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

LLVM IR (-O2):
define i32 @crypto_box_curve25519xsalsa20poly1305_keypair(i8* %0, i8* %1) {
%3 = tail call i32 @randombytes(i8* %1, i32 32)
%4 = tail call i32 @crypto_scalarmult_curve25519_base(i8* %0, i8* %1)
ret i32 %4
}
unsigned sizefloat(float n) {}


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

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

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

LLVM IR (-O2):
define i32 @sizefloat(float %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void test_53(const char *msg) { (void)fprintf(stderr, "LOG: %s", msg); }


x86 assembly (clang, -O0):
<test_53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_53>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"LOG: %s\00"
define void @test_53(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
vdmoni(state) int *state;
{}


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

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

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

LLVM IR (-O2):
define i32 @vdmoni(i32* nocapture readnone %0) {
ret i32 undef
}