#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 */
scalar_t__ get_time();
int /*<<< orphan*/ strcmp(char *, char *);
double duracion_comparacion_clasica(int iter, char *destino, char *origen) {
  int i;
  double time = 0;
  for (i = 0; i < iter; i++) {
    get_time();
    strcmp(destino, origen);
    time += get_time();
  }
  return time;
}


x86 assembly (clang, -O0):
<duracion_comparacion_clasica>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1186 <duracion_comparacion_clasica+0x66>
mov    $0x0,%al
call   1030 <get_time@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    $0x0,%al
call   1030 <get_time@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <duracion_comparacion_clasica+0x22>
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duracion_comparacion_clasica>:
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
jle    1159 <duracion_comparacion_clasica+0x49>
mov    %edi,%ebx
xorps  %xmm0,%xmm0
xchg   %ax,%ax
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <get_time@plt>
xor    %eax,%eax
call   1030 <get_time@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0xffffffff,%ebx
jne    1120 <duracion_comparacion_clasica+0x10>
jmp    115c <duracion_comparacion_clasica+0x4c>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @duracion_comparacion_clasica(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi double [ %11, %5 ], [ 0.000000e+00, %3 ]
%7 = phi i32 [ %12, %5 ], [ 0, %3 ]
%8 = tail call i64 (...) @get_time()
%9 = tail call i64 (...) @get_time()
%10 = sitofp i64 %9 to double
%11 = fadd double %6, %10
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
%15 = phi double [ 0.000000e+00, %3 ], [ %11, %5 ]
ret double %15
}