#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 convert_method2(char *);
double gettime();
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  int no = 100, val;
  double s1, e1, s2, e2;
  double t1 = 0.0, t2 = 0.0;
  char str[] = "convert this i'm going to ttatatataataa ich leibe";
  char tpr[20];
  s2 = gettime();
  val = convert_method2(str);
  e2 = gettime();
  t2 = (double)e2 - s2;
  printf("first = %.3f\n second = %.3f\n", t1, t2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x32,%edx
call   1050 <memcpy@plt>
mov    $0x0,%al
call   1060 <gettime@plt>
movsd  %xmm0,-0x28(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <convert_method2@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <gettime@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movapd 0xeac(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
movw   $0x65,0x40(%rsp)
xor    %eax,%eax
call   1050 <gettime@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <convert_method2@plt>
xor    %eax,%eax
call   1050 <gettime@plt>
movapd %xmm0,%xmm1
subsd  0x8(%rsp),%xmm1
lea    0xea2(%rip),%rdi
xorpd  %xmm0,%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [50 x i8] c"convert this i'm going to ttatatataataa ich leibe\00"
@.str = [29 x i8] c"first = %.3f\0A second = %.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca [50 x i8]
%11 = alloca [20 x i8]
store i32 0, i32* %1
store i32 100, i32* %2
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
%12 = bitcast [50 x i8]* %10 to i8*
%13 = call double (...) @gettime()
store double %13, double* %6
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%15 = call i32 @convert_method2(i8* %14)
store i32 %15, i32* %3
%16 = call double (...) @gettime()
store double %16, double* %7
%17 = load double, double* %7
%18 = load double, double* %6
%19 = fsub double %17, %18
store double %19, double* %9
%20 = load double, double* %8
%21 = load double, double* %9
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double %20, double %21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [50 x i8] c"convert this i'm going to ttatatataataa ich leibe\00"
@.str = [29 x i8] c"first = %.3f\0A second = %.3f\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call double (...) @gettime()
%4 = call i32 @convert_method2(i8* %2)
%5 = call double (...) @gettime()
%6 = fsub double %5, %3
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double 0.000000e+00, double %6)
ret i32 0
}