#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ ll_delete(int, int, int);
int /*<<< orphan*/ ll_freetable(int);
int /*<<< orphan*/ ll_insert(int, int, int, int *);
int ll_newtable();
int /*<<< orphan*/ m_time(float *);
scalar_t__ sqrt(double);
float ll_EstimateID(int datasize) {
  int tid;
  float t;
  int x = (int)sqrt((double)datasize), e = 5;
  float et;
  tid = ll_newtable();
  m_time(NULL);
  ll_insert(tid, x, x, &e);
  m_time(&et);
  t = (float)et;
  m_time(NULL);
  ll_delete(tid, x, x);
  m_time(&et);
  t = (t + (float)et) / 2;
  ll_freetable(tid);
  return t;
}


x86 assembly (clang, -O0):
<ll_EstimateID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1060 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    $0x0,%al
call   1070 <ll_newtable@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <m_time@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rcx
call   1080 <ll_insert@plt>
lea    -0x18(%rbp),%rdi
call   1040 <m_time@plt>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <m_time@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <ll_delete@plt>
lea    -0x18(%rbp),%rdi
call   1040 <m_time@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  0xe17(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ll_freetable@plt>
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_EstimateID>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cvtsi2sd %edi,%xmm0
call   1060 <sqrt@plt>
mov    %rax,%rbx
movl   $0x5,0xc(%rsp)
xor    %eax,%eax
call   1070 <ll_newtable@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1040 <m_time@plt>
lea    0xc(%rsp),%rcx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %ebx,%edx
call   1080 <ll_insert@plt>
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <m_time@plt>
movss  0x8(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
xor    %edi,%edi
call   1040 <m_time@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %ebx,%edx
call   1050 <ll_delete@plt>
mov    %r14,%rdi
call   1040 <m_time@plt>
movss  0x4(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
mulss  0xe1d(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
mov    %ebp,%edi
call   1030 <ll_freetable@plt>
movss  0x4(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @ll_EstimateID(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = call i64 @sqrt(double %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
store i32 5, i32* %6
%12 = call i32 (...) @ll_newtable()
store i32 %12, i32* %3
%13 = call i32 @m_time(float* null)
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = call i32 @ll_insert(i32 %14, i32 %15, i32 %16, i32* %6)
%18 = call i32 @m_time(float* %7)
%19 = load float, float* %7
store float %19, float* %4
%20 = call i32 @m_time(float* null)
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = load i32, i32* %5
%24 = call i32 @ll_delete(i32 %21, i32 %22, i32 %23)
%25 = call i32 @m_time(float* %7)
%26 = load float, float* %4
%27 = load float, float* %7
%28 = fadd float %26, %27
%29 = fdiv float %28, 2.000000e+00
store float %29, float* %4
%30 = load i32, i32* %3
%31 = call i32 @ll_freetable(i32 %30)
%32 = load float, float* %4
ret float %32
}

LLVM IR (-O2):
define float @ll_EstimateID(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = sitofp i32 %0 to double
%5 = tail call i64 @sqrt(double %4)
%6 = trunc i64 %5 to i32
%7 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%8 = bitcast float* %3 to i8*
%9 = tail call i32 (...) @ll_newtable()
%10 = tail call i32 @m_time(float* null)
%11 = call i32 @ll_insert(i32 %9, i32 %6, i32 %6, i32* %2)
%12 = call i32 @m_time(float* %3)
%13 = load float, float* %3
%14 = call i32 @m_time(float* null)
%15 = call i32 @ll_delete(i32 %9, i32 %6, i32 %6)
%16 = call i32 @m_time(float* %3)
%17 = load float, float* %3
%18 = fadd float %13, %17
%19 = fmul float %18, 5.000000e-01
%20 = call i32 @ll_freetable(i32 %9)
ret float %19
}