#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float, float, char *);
int /*<<< orphan*/ intToChar(int, char *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void escribirxy_txt_number(float x, float y, int numbername) {
  time_t tiempo = time(0);
  struct tm *tlocal = localtime(&tiempo);
  char output[128];
  strftime(output, 128, "%d/%m/%y %H:%M:%S", tlocal);
  FILE *fileout;
  int i = 0;
  char filename[26] = "Data";
  char indice[3] = "";
  char format[5] = ".txt";
  intToChar(numbername, indice);
  strcat(filename, indice);
  strcat(filename, format);
  fileout = fopen(filename, "a");
  fprintf(fileout, "%f %f %s \n", x, y, output);
  fclose(fileout);
}


x86 assembly (clang, -O0):
<escribirxy_txt_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x80,%esi
lea    0xe2a(%rip),%rdx
call   1080 <strftime@plt>
movl   $0x0,-0xac(%rbp)
mov    0xe44(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0xe3e(%rip),%rax
mov    %rax,-0xc8(%rbp)
mov    0xe38(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe32(%rip),%ax
mov    %ax,-0xb8(%rbp)
lea    -0xd3(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1050 <memset@plt>
mov    0xddc(%rip),%eax
mov    %eax,-0xd8(%rbp)
mov    0xdd4(%rip),%al
mov    %al,-0xd4(%rbp)
mov    -0xc(%rbp),%edi
lea    -0xd3(%rbp),%rsi
call   10a0 <intToChar@plt>
lea    -0xd0(%rbp),%rdi
lea    -0xd3(%rbp),%rsi
call   10b0 <strcat@plt>
lea    -0xd0(%rbp),%rdi
lea    -0xd8(%rbp),%rsi
call   10b0 <strcat@plt>
lea    -0xd0(%rbp),%rdi
lea    0xd8c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xa0(%rbp),%rdx
lea    0xd63(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0xa8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escribirxy_txt_number>:
push   %rbp
push   %r14
push   %rbx
sub    $0xc0,%rsp
mov    %edi,%ebp
movss  %xmm1,0x18(%rsp)
movss  %xmm0,0x14(%rsp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0x1c(%rsp)
lea    0x1c(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe4b(%rip),%rdx
lea    0x40(%rsp),%r14
mov    %r14,%rdi
mov    $0x80,%esi
mov    %rax,%rcx
call   1070 <strftime@plt>
movups 0xe69(%rip),%xmm0
movups %xmm0,0x2a(%rsp)
movaps 0xe53(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movb   $0x0,0xa(%rsp)
movw   $0x0,0x8(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x7478742e,0xc(%rsp)
74
lea    0x8(%rsp),%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1090 <intToChar@plt>
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10a0 <strcat@plt>
lea    0xc(%rsp),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
lea    0xde9(%rip),%rsi
mov    %rbp,%rdi
call   1080 <fopen@plt>
mov    %rax,%rbx
lea    0xdd9(%rip),%rsi
mov    %rax,%rdi
movss  0x14(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
mov    %r14,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%d/%m/%y %H:%M:%S\00"
@__const.escribirxy_txt_number.filename = [26 x i8] c"Data\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.escribirxy_txt_number.format = [5 x i8] c".txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [11 x i8] c"%f %f %s \0A\00"
define void @escribirxy_txt_number(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.tm*
%9 = alloca [128 x i8]
%10 = alloca i32*
%11 = alloca i32
%12 = alloca [26 x i8]
%13 = alloca [3 x i8]
%14 = alloca [5 x i8]
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%15 = call i32 @time(i32 0)
store i32 %15, i32* %7
%16 = call %struct.tm* @localtime(i32* %7)
store %struct.tm* %16, %struct.tm** %8
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%18 = load %struct.tm*, %struct.tm** %8
%19 = call i32 @strftime(i8* %17, i32 128, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %18)
store i32 0, i32* %11
%20 = bitcast [26 x i8]* %12 to i8*
%21 = bitcast [3 x i8]* %13 to i8*
%22 = bitcast [5 x i8]* %14 to i8*
%23 = load i32, i32* %6
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%25 = call i32 @intToChar(i32 %23, i8* %24)
%26 = getelementptr inbounds [26 x i8], [26 x i8]* %12, i64 0, i64 0
%27 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%28 = call i32 @strcat(i8* %26, i8* %27)
%29 = getelementptr inbounds [26 x i8], [26 x i8]* %12, i64 0, i64 0
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %14, i64 0, i64 0
%31 = call i32 @strcat(i8* %29, i8* %30)
%32 = getelementptr inbounds [26 x i8], [26 x i8]* %12, i64 0, i64 0
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %33, i32** %10
%34 = load i32*, i32** %10
%35 = load float, float* %4
%36 = load float, float* %5
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%38 = call i32 @fprintf(i32* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %35, float %36, i8* %37)
%39 = load i32*, i32** %10
%40 = call i32 @fclose(i32* %39)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%d/%m/%y %H:%M:%S\00"
@__const.escribirxy_txt_number.filename = [26 x i8] c"Data\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.escribirxy_txt_number.format = [5 x i8] c".txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [11 x i8] c"%f %f %s \0A\00"
define void @escribirxy_txt_number(float %0, float %1, i32 %2) {
%4 = alloca i32
%5 = alloca [128 x i8]
%6 = alloca [26 x i8]
%7 = alloca [3 x i8]
%8 = alloca [5 x i8]
%9 = bitcast i32* %4 to i8*
%10 = tail call i32 @time(i32 0)
store i32 %10, i32* %4
%11 = call %struct.tm* @localtime(i32* %4)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%13 = call i32 @strftime(i8* %12, i32 128, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
%14 = getelementptr inbounds [26 x i8], [26 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%17 = call i32 @intToChar(i32 %2, i8* %15)
%18 = call i32 @strcat(i8* %14, i8* %15)
%19 = call i32 @strcat(i8* %14, i8* %16)
%20 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %0, float %1, i8* %12)
%22 = call i32 @fclose(i32* %20)
ret void
}