xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
finish(FILE *f, int s) {
  if (f != NULL)
    fclose(f);
  close(s);
}


x86 assembly (clang, -O0):
<finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1143 <finish+0x23>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish>:
push   %rbx
mov    %esi,%ebx
test   %rdi,%rdi
je     112d <finish+0xd>
call   1030 <fclose@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
define i32 @finish(i32* %0, i32 %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @fclose(i32* %0)
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @close(i32 %1)
ret i32 undef
}
unsigned short QCRC_Value(unsigned short crcvalue) { return crcvalue ^ 0x0000; }


x86 assembly (clang, -O0):
<QCRC_Value>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
xor    $0x0,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QCRC_Value>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @QCRC_Value(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = xor i32 %4, 0
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @QCRC_Value(i16 returned zeroext %0) {
ret i16 %0
}
/* Variables and functions */
void *_lsearch(void const *, void *, unsigned int *, unsigned int,
               int (*)(void const *, void const *));
void *lsearch(const void *match, void *start, unsigned int *array_size,
              unsigned int elem_size, int (*cf)(const void *, const void *)) {
  return _lsearch(match, start, array_size, elem_size, cf);
}


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

x86 assembly (clang, -O2):
<lsearch>:
jmp    1030 <_lsearch@plt>

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

LLVM IR (-O2):
define i8* @lsearch(i8* %0, i8* %1, i32* %2, i32 %3, i32 (i8*, i8*)* %4) {
%6 = tail call i8* @_lsearch(i8* %0, i8* %1, i32* %2, i32 %3, i32 (i8*, i8*)* %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void cursormove(int arg1, int arg2) {
  printf("\x1b["
         "%d;%dH",
         arg1, arg2);
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @cursormove(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *, char *, int);
char *strerror(int);
void MyErr3(const char *err_string, int line, int error) {
  printf("error : line : %d %s() : %s with errno : %d\n", line, err_string,
         strerror(error), error);
}


x86 assembly (clang, -O0):
<MyErr3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
mov    -0x10(%rbp),%r8d
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyErr3>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %rax,%rcx
mov    %ebx,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [45 x i8] c"error : line : %d %s() : %s with errno : %d\0A\00"
define void @MyErr3(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @strerror(i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0, i8* %4, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_func(void) { printf("Hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define void @my_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int C(int n, int k) {
  if (k == 0 || k == n) {
    return 1;
  } else {
    return C(n - 1, k - 1) + C(n - 1, k);
  }
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1134 <C+0x24>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <C+0x30>
movl   $0x1,-0x4(%rbp)
jmp    116c <C+0x5c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <C@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <C@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %esi,%esi
je     1162 <C+0x52>
mov    %esi,%r14d
mov    %edi,%ebx
cmp    %edi,%esi
je     1162 <C+0x52>
lea    -0x1(%r14),%r15d
neg    %r14d
add    $0xffffffff,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <C@plt>
add    %eax,%ebp
lea    (%r14,%rbx,1),%eax
add    $0xffffffff,%eax
mov    %ebx,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%ebx
cmp    $0xffffffff,%eax
jne    1140 <C+0x30>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @C(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp eq i32 %1, %0
%5 = or i1 %3, %4
br i1 %5, label %17, label %6
6: ; preds = %2
%7 = add nsw i32 %1, -1
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %0, %6 ], [ %11, %8 ]
%10 = phi i32 [ 0, %6 ], [ %13, %8 ]
%11 = add nsw i32 %9, -1
%12 = tail call i32 @C(i32 %11, i32 %7)
%13 = add nsw i32 %12, %10
%14 = icmp eq i32 %11, %1
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = add i32 %13, 1
br label %17
17: ; preds = %15, %2
%18 = phi i32 [ 1, %2 ], [ %16, %15 ]
ret i32 %18
}
int f_lt_mr2(float *a1, float a2) { return !(((*a1) < (a2))); }


x86 assembly (clang, -O0):
<f_lt_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_lt_mr2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_lt_mr2(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* %5
%7 = load float, float* %4
%8 = fcmp olt float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_lt_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp uge float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void socketClose(int socket) { close(socket); }


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

x86 assembly (clang, -O2):
<socketClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @socketClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int d_cmp(const double *a, const double *b) {
  if (*a < *b)
    return -1;
  if (*a > *b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<d_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <d_cmp+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <d_cmp+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <d_cmp+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <d_cmp+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @d_cmp(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ rb_islower(int);
int rb_toupper(int c) { return rb_islower(c) ? (c & 0x5f) : c; }


x86 assembly (clang, -O0):
<rb_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rb_islower@plt>
cmp    $0x0,%rax
je     113b <rb_toupper+0x2b>
mov    -0x4(%rbp),%eax
and    $0x5f,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <rb_toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <rb_islower@plt>
mov    %ebx,%ecx
and    $0x5f,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rb_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @rb_islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 95
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @rb_toupper(i32 %0) {
%2 = tail call i64 @rb_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, 95
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void shsync() { return; }


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

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

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

LLVM IR (-O2):
define void @shsync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(
      stderr,
      "Usage: AMBEserver [-d] [-r] [-s speed] [-p port] [-i tty] [-v] [-x]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"Usage: AMBEserver [-d] [-r] [-s speed] [-p port] [-i tty] [-v] [-x]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"Usage: AMBEserver [-d] [-r] [-s speed] [-p port] [-i tty] [-v] [-x]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
extern unsigned unsigned_greater_equal(unsigned a, unsigned b) {
  return a >= b;
}


x86 assembly (clang, -O0):
<unsigned_greater_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_greater_equal>:
xor    %eax,%eax
cmp    %esi,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @unsigned_greater_equal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp uge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @unsigned_greater_equal(i32 %0, i32 %1) {
%3 = icmp uge i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long long);
void double_to_char(double d, char *dest) {
  sprintf(dest, "%llx", *(unsigned long long *)&d);
}


x86 assembly (clang, -O0):
<double_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_char>:
movq   %xmm0,%rdx
lea    0xee4(%rip),%rsi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%llx\00"
define void @double_to_char(double %0, i8* nocapture writeonly %1) {
%3 = bitcast double %0 to i64
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}
void hostapd_wps_eap_completed(struct hostapd_data *hapd) {}


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

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

LLVM IR (-O0):
%struct.hostapd_data = type opaque
define void @hostapd_wps_eap_completed(%struct.hostapd_data* %0) {
%2 = alloca %struct.hostapd_data*
store %struct.hostapd_data* %0, %struct.hostapd_data** %2
ret void
}

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define void @hostapd_wps_eap_completed(%struct.hostapd_data* nocapture %0) {
ret void
}
int _float_is_left_of(float a, float b) { return a <= b; }


x86 assembly (clang, -O0):
<_float_is_left_of>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_float_is_left_of>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @_float_is_left_of(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 ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_float_is_left_of(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_49uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x49 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_49uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x49,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_49uint64_lowword_reg>:
test   $0x49,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_49uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 73
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, int /*<<< orphan*/ *, int);
unsigned char *pack_int32(unsigned char *to, int32_t intval) {
  intval = htonl(intval);
  memcpy(to, &intval, sizeof(int32_t));
  return to + sizeof(int32_t);
}


x86 assembly (clang, -O0):
<pack_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_int32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pack_int32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htonl(i32 %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %7, i32* %4, i32 4)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 4
ret i8* %10
}

LLVM IR (-O2):
define i8* @pack_int32(i8* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
%6 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %6
}
/* Variables and functions */
scalar_t__ SYS_unlink;
int syscall(long, long);
int unlink(const char *pathname) {
  return syscall((long)SYS_unlink, (long)pathname);
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    %rdi,%rsi
mov    0x2ede(%rip),%rax
mov    (%rax),%rdi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_unlink = global i64 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @SYS_unlink
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = call i32 @syscall(i64 %3, i64 %5)
ret i32 %6
}

LLVM IR (-O2):
@SYS_unlink = global i64 0
define i32 @unlink(i8* %0) {
%2 = load i64, i64* @SYS_unlink
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @syscall(i64 %2, i64 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hs_hash32(uint32_t key, unsigned int order) {
  key = (key ^ 61) ^ (key >> 16);
  key = key + (key << 3);
  key = key ^ (key >> 4);
  key = key * 0x27d4eb2d;
  key = key ^ (key >> 15);
  return (key >> (32 - (order)));
}


x86 assembly (clang, -O0):
<hs_hash32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3d,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x27d4eb2d,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hs_hash32>:
mov    %esi,%ecx
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
xor    $0x3d,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%edx
sar    $0x4,%edx
xor    %eax,%edx
imul   $0x27d4eb2d,%edx,%edx
mov    %edx,%eax
sar    $0xf,%eax
xor    %edx,%eax
neg    %cl
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @hs_hash32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = xor i32 %5, 61
%7 = load i32, i32* %3
%8 = ashr i32 %7, 16
%9 = xor i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = shl i32 %11, 3
%13 = add nsw i32 %10, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = ashr i32 %15, 4
%17 = xor i32 %14, %16
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = mul nsw i32 %18, 668265261
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = ashr i32 %21, 15
%23 = xor i32 %20, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = sub i32 32, %25
%27 = ashr i32 %24, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @hs_hash32(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = xor i32 %3, %0
%5 = xor i32 %4, 61
%6 = mul i32 %5, 9
%7 = ashr i32 %6, 4
%8 = xor i32 %7, %6
%9 = mul nsw i32 %8, 668265261
%10 = ashr i32 %9, 15
%11 = xor i32 %10, %9
%12 = sub i32 32, %1
%13 = ashr i32 %11, %12
ret i32 %13
}
/* Variables and functions */
char getchar();
void go_to_comment_end() {
  char c, d;
  c = getchar();
  d = getchar();
  while (c != '*' || d != '/') {
    c = d;
    d = getchar();
  }
}


x86 assembly (clang, -O0):
<go_to_comment_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0x3(%rbp)
jne    114b <go_to_comment_end+0x3b>
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
test   $0x1,%al
jne    115b <go_to_comment_end+0x4b>
jmp    1170 <go_to_comment_end+0x60>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x2(%rbp)
jmp    112c <go_to_comment_end+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_to_comment_end>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x2a,%bl
jne    1120 <go_to_comment_end+0x10>
cmp    $0x2f,%al
jne    1120 <go_to_comment_end+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @go_to_comment_end() {
%1 = alloca i8
%2 = alloca i8
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
br label %5
5: ; preds = %15, %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 42
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 47
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ true, %5 ], [ %12, %9 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8, i8* %2
store i8 %16, i8* %1
%17 = call signext i8 (...) @getchar()
store i8 %17, i8* %2
br label %5
18: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @go_to_comment_end() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call signext i8 (...) @getchar()
%3 = icmp ne i8 %1, 42
%4 = icmp ne i8 %2, 47
%5 = or i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i8 [ %8, %6 ], [ %2, %0 ]
%8 = tail call signext i8 (...) @getchar()
%9 = icmp ne i8 %7, 42
%10 = icmp ne i8 %8, 47
%11 = or i1 %9, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Car_Set(int);
int /*<<< orphan*/ Car_SetSpeed(int /*<<< orphan*/, int);
void Car_SetCarSpeed(int carnum, int Speed) {
  Car_SetSpeed(Car_Set(carnum), Speed);
}


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

x86 assembly (clang, -O2):
<Car_SetCarSpeed>:
push   %rbx
mov    %esi,%ebx
call   1030 <Car_Set@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <Car_SetSpeed@plt>

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

LLVM IR (-O2):
define void @Car_SetCarSpeed(i32 %0, i32 %1) {
%3 = tail call i32 @Car_Set(i32 %0)
%4 = tail call i32 @Car_SetSpeed(i32 %3, i32 %1)
ret void
}
void invd(void) { asm volatile("invd" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @invd() {
tail call void asm sideeffect "invd", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int logicalShift(int x, int n) {
  x = x >> n;
  return (~((~(0)) << (32 + ~n + 1))) & x;
}


x86 assembly (clang, -O0):
<logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x20,%ecx
add    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicalShift>:
mov    %esi,%ecx
sar    %cl,%edi
neg    %cl
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = add nsw i32 32, %9
%11 = add nsw i32 %10, 1
%12 = shl i32 -1, %11
%13 = xor i32 %12, -1
%14 = load i32, i32* %3
%15 = and i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl nsw i32 -1, %4
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ CG_DrawOldTourneyScoreboard();
void CG_DrawTourneyScoreboard(void) { CG_DrawOldTourneyScoreboard(); }


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

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

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

LLVM IR (-O2):
define void @CG_DrawTourneyScoreboard() {
%1 = tail call i32 (...) @CG_DrawOldTourneyScoreboard()
ret void
}
/* Variables and functions */
size_t fts_pow2(size_t x) {
  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x++;
  return (x);
}


x86 assembly (clang, -O0):
<fts_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_pow2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x8,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x10,%rax
or     %rdx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @fts_pow2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = add i64 %25, 1
store i64 %26, i64* %2
%27 = load i64, i64* %2
ret i64 %27
}

LLVM IR (-O2):
define i64 @fts_pow2(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = add i64 %12, 1
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ energyConsumptionBill(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double kwh;
  printf("Consumo mensal (em Kwh): ");
  scanf(" %lf", &kwh);
  printf("Conta: R$ %.2lf\n", energyConsumptionBill(kwh));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <energyConsumptionBill@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <energyConsumptionBill@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Consumo mensal (em Kwh): \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [17 x i8] c"Conta: R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call i32 @energyConsumptionBill(double %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Consumo mensal (em Kwh): \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [17 x i8] c"Conta: R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 @energyConsumptionBill(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) {
  __asm__("cpuid" : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) : "0"(op));
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x40(%rbp),%rax
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
mov    %rcx,%r9
mov    %rdx,%r10
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %15)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void noroom(void) {
  fprintf(stderr, "Insufficient data space.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<noroom>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<noroom>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Insufficient data space.\0A\00"
define void @noroom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Insufficient data space.\0A\00"
define void @noroom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
double const invgammp(double const, double const);
double qgamma(const double p, const double alpha, const double beta) {
  if (p < 0. || p >= 1.)
    error("bad p in pgamma");
  return invgammp(p, alpha) / beta;
}


x86 assembly (clang, -O0):
<qgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
ja     115c <qgamma+0x3c>
movsd  -0x8(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <qgamma+0x48>
lea    0xea5(%rip),%rdi
call   1040 <error@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <invgammp@plt>
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qgamma>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
ja     113e <qgamma+0x1e>
ucomisd 0xec4(%rip),%xmm0
jb     1160 <qgamma+0x40>
lea    0xec3(%rip),%rdi
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <error@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <invgammp@plt>
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"bad p in pgamma\00"
define double @qgamma(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 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load double, double* %4
%11 = fcmp oge double %10, 1.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9, %3
%13 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = call double @invgammp(double %15, double %16)
%18 = load double, double* %6
%19 = fdiv double %17, %18
ret double %19
}

LLVM IR (-O2):
@.str = [16 x i8] c"bad p in pgamma\00"
define double @qgamma(double %0, double %1, double %2) {
%4 = fcmp olt double %0, 0.000000e+00
%5 = fcmp oge double %0, 1.000000e+00
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = tail call double @invgammp(double %0, double %1)
%11 = fdiv double %10, %2
ret double %11
}
int fb_SGNl(long long int x) {
  if (x == 0)
    return 0ll;
  else if (x > 0ll)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<fb_SGNl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <fb_SGNl+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    113d <fb_SGNl+0x3d>
cmpq   $0x0,-0x10(%rbp)
jle    1136 <fb_SGNl+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <fb_SGNl+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_SGNl>:
xor    %ecx,%ecx
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fb_SGNl(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = icmp sgt i64 %0, 0
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drshft_(int *, int *, int *, double *, int *);
void wcc_drshft_(int *M, int *N, int *OFFSET, char *A, int *LDA) {
  drshft_(M, N, OFFSET, (double *)A, LDA);
}


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

x86 assembly (clang, -O2):
<wcc_drshft_>:
jmp    1030 <drshft_@plt>

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

LLVM IR (-O2):
define void @wcc_drshft_(i32* %0, i32* %1, i32* %2, i8* %3, i32* %4) {
%6 = bitcast i8* %3 to double*
%7 = tail call i32 @drshft_(i32* %0, i32* %1, i32* %2, double* %6, i32* %4)
ret void
}
/* Variables and functions */
int scanf(char *, char *);
int read_from_stdin(char *buf) {
  int ret = scanf("%s", buf);
  return ret;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @read_from_stdin(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ porting_dbg(char *);
int yp_get_default_domain(char **domain) {
  porting_dbg("** NO NIS module **");
  *domain = "";
  return 12;
}


x86 assembly (clang, -O0):
<yp_get_default_domain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <porting_dbg@plt>
mov    -0x8(%rbp),%rax
lea    0xee0(%rip),%rcx
mov    %rcx,(%rax)
mov    $0xc,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yp_get_default_domain>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <porting_dbg@plt>
lea    0xeec(%rip),%rax
mov    %rax,(%rbx)
mov    $0xc,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"** NO NIS module **\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @yp_get_default_domain(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @porting_dbg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %4
ret i32 12
}

LLVM IR (-O2):
@.str = [20 x i8] c"** NO NIS module **\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @yp_get_default_domain(i8** nocapture writeonly %0) {
%2 = tail call i32 @porting_dbg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %0
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ Gp(int);
int /*<<< orphan*/ printf(char *, char *);
void p(char *s) {
  printf("C: %s\n", s);
  Gp(888);
}


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

x86 assembly (clang, -O2):
<p>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x378,%edi
pop    %rax
jmp    1040 <Gp@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"C: %s\0A\00"
define void @p(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @Gp(i32 888)
ret void
}