xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t read_FD_BE(int, double *, int);
size_t float64ReadFromFD(int fd, double *data) {
  return read_FD_BE(fd, data, sizeof(double));
}


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

x86 assembly (clang, -O2):
<float64ReadFromFD>:
mov    $0x8,%edx
jmp    1030 <read_FD_BE@plt>

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

LLVM IR (-O2):
define i64 @float64ReadFromFD(i32 %0, double* %1) {
%3 = tail call i64 @read_FD_BE(i32 %0, double* %1, i32 8)
ret i64 %3
}
/* Variables and functions */
scalar_t__ fabs(double);
bool is_close_dbl_tol(double a, double b, double tolerance) {
  return (fabs(a - b) <= (tolerance + fabs(b)));
}


x86 assembly (clang, -O0):
<is_close_dbl_tol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
cvtsi2sd %rax,%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_close_dbl_tol>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x10(%rsp),%xmm0
xor    %eax,%eax
ucomisd 0x8(%rsp),%xmm0
setae  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @is_close_dbl_tol(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call i64 @fabs(double %9)
%11 = sitofp i64 %10 to double
%12 = load double, double* %6
%13 = load double, double* %5
%14 = call i64 @fabs(double %13)
%15 = sitofp i64 %14 to double
%16 = fadd double %12, %15
%17 = fcmp ole double %11, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_close_dbl_tol(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call i64 @fabs(double %4)
%6 = sitofp i64 %5 to double
%7 = tail call i64 @fabs(double %1)
%8 = sitofp i64 %7 to double
%9 = fadd double %8, %2
%10 = fcmp oge double %9, %6
%11 = zext i1 %10 to i32
ret i32 %11
}
void UnlockMem(int hMem) { return; }


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

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

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

LLVM IR (-O2):
define void @UnlockMem(i32 %0) {
ret void
}
void tlabel() {}


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

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

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

LLVM IR (-O2):
define void @tlabel() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_indent(int indent) {
  int i;
  for (i = 0; i < indent; i++) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <print_indent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <print_indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct Vector {
  int dummy;
};

/* Variables and functions */
struct Vector *vector_get_reserve(int);
struct Vector *vector_get() {
  return vector_get_reserve(6);
}


x86 assembly (clang, -O0):
<vector_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <vector_get_reserve@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_get>:
mov    $0x6,%edi
jmp    1030 <vector_get_reserve@plt>

LLVM IR (-O0):
%struct.Vector = type { i32 }
define %struct.Vector* @vector_get() {
%1 = call %struct.Vector* @vector_get_reserve(i32 6)
ret %struct.Vector* %1
}

LLVM IR (-O2):
%struct.Vector = type { i32 }
define %struct.Vector* @vector_get() {
%1 = tail call %struct.Vector* @vector_get_reserve(i32 6)
ret %struct.Vector* %1
}
/* Variables and functions */
int /*<<< orphan*/ add_something(int);
void add_something_no_io(int add_this) { add_something(add_this); }


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

x86 assembly (clang, -O2):
<add_something_no_io>:
jmp    1030 <add_something@plt>

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

LLVM IR (-O2):
define void @add_something_no_io(i32 %0) {
%2 = tail call i32 @add_something(i32 %0)
ret void
}
int check_unzip_version(unzippath)
char *unzippath;
{ return 1; }


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

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

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

LLVM IR (-O2):
define i32 @check_unzip_version(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct trace_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct trace_item *);
void _give_back_trace_item(struct trace_item *item) {
  if (NULL != item) {
    free(item);
  }
}


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

x86 assembly (clang, -O2):
<_give_back_trace_item>:
test   %rdi,%rdi
je     111a <_give_back_trace_item+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.trace_item = type { i32 }
define void @_give_back_trace_item(%struct.trace_item* %0) {
%2 = icmp eq %struct.trace_item* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.trace_item* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_malloc(void *p) {
  if (p == NULL) {
    fprintf(stderr, "Can't malloc!\n");
    exit(-3);
  }
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <check_malloc+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffd,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc>:
test   %rdi,%rdi
je     1126 <check_malloc+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffd,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Can't malloc!\0A\00"
define void @check_malloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -3)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Can't malloc!\0A\00"
define void @check_malloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -3)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
void om_text_print_numkey_info(FILE *fp, char *key, int val) {
  fprintf(fp, "* %s: %d\n", key, val);
}


x86 assembly (clang, -O0):
<om_text_print_numkey_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_text_print_numkey_info>:
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"* %s: %d\0A\00"
define void @om_text_print_numkey_info(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
int cmp_less_fp32(const void *p, const void *q) {
  const float a = *(const float *)p;
  const float b = *(const float *)q;
  if (a > b)
    return +1;
  if (b > a)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_less_fp32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1141 <cmp_less_fp32+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1163 <cmp_less_fp32+0x63>
movss  -0x20(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    115c <cmp_less_fp32+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <cmp_less_fp32+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_less_fp32>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_less_fp32(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
store float %10, float* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to float*
%13 = load float, float* %12
store float %13, float* %7
%14 = load float, float* %6
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load float, float* %7
%20 = load float, float* %6
%21 = fcmp ogt float %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_less_fp32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp ogt float %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc22(int status, void *arg) {
  printf("Executing exitfunc22 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


x86 assembly (clang, -O0):
<exitfunc22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc22>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc22 (status=%d, arg=%d)\0A\00"
define void @exitfunc22(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc22 (status=%d, arg=%d)\0A\00"
define void @exitfunc22(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sq_print_element(int *x) { printf("%d\n", *x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @sq_print_element(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int key_gen(char *);
int key_gen_auto(void) { return key_gen("/etc/xrdp/rsakeys.ini"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"/etc/xrdp/rsakeys.ini\00"
define i32 @key_gen_auto() {
%1 = call i32 @key_gen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [22 x i8] c"/etc/xrdp/rsakeys.ini\00"
define i32 @key_gen_auto() {
%1 = tail call i32 @key_gen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ligne_2(int x) {
  int a;
  a = 0;
  while (a != x) {
    if (a != 0 && a != x - 1) {
      ft_putchar(' ');
    } else {
      ft_putchar('*');
    }
    a++;
  }
}


x86 assembly (clang, -O0):
<ligne_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1170 <ligne_2+0x60>
cmpl   $0x0,-0x8(%rbp)
je     1158 <ligne_2+0x48>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1158 <ligne_2+0x48>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
jmp    1162 <ligne_2+0x52>
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <ligne_2+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ligne_2>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1151 <ligne_2+0x41>
mov    %edi,%r14d
xor    %ebx,%ebx
mov    $0x2a,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%eax
cmp    $0x1,%eax
mov    $0x20,%edi
cmove  %ebp,%edi
sub    $0x1,%ebx
cmovb  %ebp,%edi
call   1030 <ft_putchar@plt>
mov    %r14d,%eax
add    %ebx,%eax
jne    1130 <ligne_2+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ligne_2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %23
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @ft_putchar(i8 signext 32)
br label %20
18: ; preds = %11, %8
%19 = call i32 @ft_putchar(i8 signext 42)
br label %20
20: ; preds = %18, %16
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ligne_2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %12, %5 ]
%7 = icmp eq i32 %6, 0
%8 = icmp eq i32 %6, %4
%9 = select i1 %7, i1 true, i1 %8
%10 = select i1 %9, i8 42, i8 32
%11 = tail call i32 @ft_putchar(i8 signext %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_scalblnf();
scalar_t__ scalblnf(float, long);
void test_scalblnf(float f, long int x) {
  if (scalblnf(f, x) != scalblnf(f, x))
    link_failure_scalblnf();
}


x86 assembly (clang, -O0):
<test_scalblnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1040 <scalblnf@plt>
mov    %rax,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1040 <scalblnf@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1168 <test_scalblnf+0x48>
mov    $0x0,%al
call   1030 <link_failure_scalblnf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalblnf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movss  %xmm0,0x4(%rsp)
call   1040 <scalblnf@plt>
mov    %rax,%r14
movss  0x4(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <scalblnf@plt>
cmp    %rax,%r14
jne    1150 <test_scalblnf+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <link_failure_scalblnf@plt>

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

LLVM IR (-O2):
define void @test_scalblnf(float %0, i64 %1) {
%3 = tail call i64 @scalblnf(float %0, i64 %1)
%4 = tail call i64 @scalblnf(float %0, i64 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_scalblnf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int imm12(uint32_t cb) {
  if (cb & (1 << 23)) {
    return (cb & 0xFFF);
  } else {
    return -(cb & 0xFFF);
  }
}


x86 assembly (clang, -O0):
<imm12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x800000,%eax
cmp    $0x0,%eax
je     1128 <imm12+0x28>
mov    -0x8(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <imm12+0x38>
mov    -0x8(%rbp),%ecx
and    $0xfff,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm12>:
mov    %edi,%ecx
and    $0xfff,%ecx
mov    %ecx,%eax
neg    %eax
test   $0x800000,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @imm12(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 8388608
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 4095
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = and i32 %11, 4095
%13 = sub nsw i32 0, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @imm12(i32 %0) {
%2 = and i32 %0, 8388608
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 4095
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
int reconnect_inet() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @reconnect_inet() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endgrent();
void setgrent() { endgrent(); }


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

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

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

LLVM IR (-O2):
define void @setgrent() {
%1 = tail call i32 (...) @endgrent()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_getppid;
long getpid();
int /*<<< orphan*/ printf(char *, long);
long syscall(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  long p = syscall(SYS_getppid);
  printf("%ld\n", p);
  printf("%ld\n", getpid());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1050 <syscall@plt>
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@SYS_getppid = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SYS_getppid
%4 = tail call i64 @syscall(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = tail call i64 (...) @getpid()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i32 0
}
void f68(void) {
  ({
    ({ 0; });
    ({
      goto a;
      0;
    });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  0;
}


x86 assembly (clang, -O0):
<f68>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f68() {
ret void
}
int __dberr(void) { return (-1); }


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

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

LLVM IR (-O0):
define i32 @__dberr() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @__dberr() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo(int a, int *pb) {
  int b = *pb;
  assert(a == b);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    %edi,(%rsi)
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @foo(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ bswap64(scalar_t__);
double minipack_unpack_double(void *ptr, size_t *sz) {
  *sz = 9;
  uint64_t value = *((uint64_t *)(ptr + 1));
  value = (uint64_t)bswap64(value);
  double *double_ptr = (double *)&value;
  return *double_ptr;
}


x86 assembly (clang, -O0):
<minipack_unpack_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x9,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <bswap64@plt>
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_double>:
push   %rax
movq   $0x9,(%rsi)
mov    0x1(%rdi),%rdi
call   1030 <bswap64@plt>
movq   %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @minipack_unpack_double(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i64
%6 = alloca double*
store i8* %0, i8** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %4
store i64 9, i64* %7
%8 = load i8*, i8** %3
%9 = getelementptr i8, i8* %8, i64 1
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = call i64 @bswap64(i64 %12)
store i64 %13, i64* %5
%14 = bitcast i64* %5 to double*
store double* %14, double** %6
%15 = load double*, double** %6
%16 = load double, double* %15
ret double %16
}

LLVM IR (-O2):
define double @minipack_unpack_double(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 9, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = tail call i64 @bswap64(i64 %5)
%7 = bitcast i64 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B, X;
  scanf("%i %i", &A, &B);
  X = A + B;
  printf("X = %d\n", X);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
double CurrentFontSize();
int script_shift(void) { return (int)(CurrentFontSize() / 3.0); }


x86 assembly (clang, -O0):
<script_shift>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CurrentFontSize@plt>
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_shift>:
push   %rax
xor    %eax,%eax
call   1030 <CurrentFontSize@plt>
divsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @script_shift() {
%1 = call double (...) @CurrentFontSize()
%2 = fdiv double %1, 3.000000e+00
%3 = fptosi double %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @script_shift() {
%1 = tail call double (...) @CurrentFontSize()
%2 = fdiv double %1, 3.000000e+00
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
long TickCount();
void hold_for_visible_delay(void) {
  long start = TickCount();
  while (TickCount() < start + 7)
    ;
}


x86 assembly (clang, -O0):
<hold_for_visible_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <TickCount@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <TickCount@plt>
mov    -0x8(%rbp),%rcx
add    $0x7,%rcx
cmp    %rcx,%rax
jge    1140 <hold_for_visible_delay+0x30>
jmp    1123 <hold_for_visible_delay+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hold_for_visible_delay>:
push   %rbx
xor    %eax,%eax
call   1030 <TickCount@plt>
mov    %rax,%rbx
add    $0x7,%rbx
nop
xor    %eax,%eax
call   1030 <TickCount@plt>
cmp    %rbx,%rax
jl     1120 <hold_for_visible_delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @hold_for_visible_delay() {
%1 = alloca i64
%2 = call i64 (...) @TickCount()
store i64 %2, i64* %1
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @TickCount()
%5 = load i64, i64* %1
%6 = add nsw i64 %5, 7
%7 = icmp slt i64 %4, %6
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @hold_for_visible_delay() {
%1 = tail call i64 (...) @TickCount()
%2 = add nsw i64 %1, 7
br label %3
3: ; preds = %3, %0
%4 = tail call i64 (...) @TickCount()
%5 = icmp slt i64 %4, %2
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
/* Variables and functions */
char const **stopword_names();
const char **corpus_stopword_names(void) { return stopword_names(); }


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

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

LLVM IR (-O0):
define i8** @corpus_stopword_names() {
%1 = call i8** (...) @stopword_names()
ret i8** %1
}

LLVM IR (-O2):
define i8** @corpus_stopword_names() {
%1 = tail call i8** (...) @stopword_names()
ret i8** %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void gnucall(char *s) { printf("%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @gnucall(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_CONF;
int sysconf(int /*<<< orphan*/);
int get_number_cpus(void) { return sysconf(_SC_NPROCESSORS_CONF); }


x86 assembly (clang, -O0):
<get_number_cpus>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number_cpus>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_CONF = global i32 0
define i32 @get_number_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_CONF
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_CONF = global i32 0
define i32 @get_number_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_CONF
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int floorf(float);
void floor_w_s(float *source, int *dest) { *dest = floorf(*source); }


x86 assembly (clang, -O0):
<floor_w_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <floorf@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor_w_s>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <floorf@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @floor_w_s(float* nocapture %0, i32* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = tail call i32 @floorf(float %3)
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ unix_path(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(int /*<<< orphan*/);
int unlink_file(const char *f) {
  char f_name[strlen(f) + 1];
  return !unlink(unix_path(strcpy(f_name, f)));
}


x86 assembly (clang, -O0):
<unlink_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    %eax,%edi
call   1060 <unix_path@plt>
mov    %eax,%edi
call   1030 <unlink@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_file>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <strlen@plt>
add    $0x1,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %eax,%edi
call   1060 <unix_path@plt>
mov    %eax,%edi
call   1030 <unlink@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unlink_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i8, i64 %8
store i64 %8, i64* %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = call i32 @unix_path(i32 %12)
%14 = call i32 @unlink(i32 %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
%18 = load i8*, i8** %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @unlink_file(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @strcpy(i8* %5, i8* %0)
%7 = call i32 @unix_path(i32 %6)
%8 = call i32 @unlink(i32 %7)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
int get2(char *c) {
  int i = 0;
  if (*c)
    i = (*c++ - '0') * 10;
  if (*c)
    i += *c - '0';
  return i;
}


x86 assembly (clang, -O0):
<get2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <get2+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <get2+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get2>:
movsbl (%rdi),%eax
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
lea    (%rax,%rax,4),%edx
lea    -0x1e0(%rdx,%rdx,1),%edx
cmove  %eax,%edx
movsbl (%rdi,%rcx,1),%ecx
lea    -0x30(%rcx),%eax
test   %ecx,%ecx
cmove  %ecx,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @get2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = sext i8 %2 to i32
%5 = mul nsw i32 %4, 10
%6 = add nsw i32 %5, -480
%7 = xor i1 %3, true
%8 = zext i1 %7 to i64
%9 = getelementptr i8, i8* %0, i64 %8
%10 = select i1 %3, i32 0, i32 %6
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
%13 = sext i8 %11 to i32
%14 = add nsw i32 %13, -48
%15 = select i1 %12, i32 0, i32 %14
%16 = add nsw i32 %10, %15
ret i32 %16
}
/* Variables and functions */
int isatty(int);
int my_isatty(int fd) { return isatty(fd); }


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

x86 assembly (clang, -O2):
<my_isatty>:
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define i32 @my_isatty(i32 %0) {
%2 = tail call i32 @isatty(i32 %0)
ret i32 %2
}
/* Variables and functions */
int isPowerOfTwo(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", isPowerOfTwo(4));
  printf("%d\n", isPowerOfTwo(256));
  printf("%d\n", isPowerOfTwo(24));
  printf("%d\n", isPowerOfTwo(1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <isPowerOfTwo@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x100,%edi
call   1030 <isPowerOfTwo@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x18,%edi
call   1030 <isPowerOfTwo@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <isPowerOfTwo@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1030 <isPowerOfTwo@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x100,%edi
call   1030 <isPowerOfTwo@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x18,%edi
call   1030 <isPowerOfTwo@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <isPowerOfTwo@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isPowerOfTwo(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isPowerOfTwo(i32 256)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isPowerOfTwo(i32 24)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @isPowerOfTwo(i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showHeader(char *nom) { printf("\n***INICI %s*** \n", nom); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"\0A***INICI %s*** \0A\00"
define void @showHeader(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A***INICI %s*** \0A\00"
define void @showHeader(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ info;

/* Variables and functions */
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
int stat(char *, struct stat *);
char *check_file_exists(char *path) {
  int err;
  struct stat info;
  memset(&info, 0, sizeof(info));
  err = stat(path, &info);
  return (err ? NULL : path);
}


x86 assembly (clang, -O0):
<check_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1161 <check_file_exists+0x41>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1169 <check_file_exists+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file_exists>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
lea    0x8(%rsp),%r14
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <stat@plt>
test   %eax,%eax
cmove  %r15,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i8* @check_file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
%5 = call i32 @memset(%struct.stat* %4, i32 0, i32 4)
%6 = load i8*, i8** %2
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %10
%14 = phi i8* [ null, %10 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i8* @check_file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @memset(%struct.stat* %2, i32 0, i32 4)
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* %0, i8* null
ret i8* %7
}