#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*/ FILE;

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ strcat(char *, char *);
void HTML_LatLongWrite(double lat, double lon) {
  char str_latitud[500];
  sprintf(str_latitud, "%f", lat);
  char str_longitud[500];
  sprintf(str_longitud, "%f", lon);
  printf("la latitud (string) es: %s  N \n", str_latitud);
  printf("la longitud (string) es: %s  W \n", str_longitud);
  FILE *in;
  in = fopen("main_html.html", "r+");
  int fin = feof(in);
  int i = 0;
  char caracteres[100];
  char cadena1[200] = "center: new google.maps.LatLng( ";
  char cadena3[200] = ",";
  char cadena5[200] = "), \n";
  strcat(cadena1, str_latitud);
  strcat(cadena1, cadena3);
  strcat(cadena1, str_longitud);
  strcat(cadena1, cadena5);
  while (feof(in) == 0) {
    fgets(caracteres, 100, in);
    i = i + 1;
    if (i == 101) {
      fputs(cadena1, in);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<HTML_LatLongWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x700,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xe48(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xe30(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x210(%rbp),%rsi
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
lea    -0x410(%rbp),%rsi
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
lea    0xe4a(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x418(%rbp)
mov    -0x418(%rbp),%rdi
call   1070 <feof@plt>
mov    %eax,-0x41c(%rbp)
movl   $0x0,-0x420(%rbp)
lea    -0x560(%rbp),%rdi
lea    0xe21(%rip),%rsi
mov    $0xc8,%edx
call   1080 <memcpy@plt>
lea    -0x630(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
movb   $0x2c,-0x630(%rbp)
lea    -0x700(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
movb   $0x29,-0x700(%rbp)
movb   $0x2c,-0x6ff(%rbp)
movb   $0x20,-0x6fe(%rbp)
movb   $0xa,-0x6fd(%rbp)
lea    -0x560(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x560(%rbp),%rdi
lea    -0x630(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x560(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x560(%rbp),%rdi
lea    -0x700(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x418(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
jne    1344 <HTML_LatLongWrite+0x1b4>
lea    -0x490(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    $0x64,%esi
call   1060 <fgets@plt>
mov    -0x420(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x420(%rbp)
cmpl   $0x65,-0x420(%rbp)
jne    133f <HTML_LatLongWrite+0x1af>
lea    -0x560(%rbp),%rdi
mov    -0x418(%rbp),%rsi
call   1040 <fputs@plt>
jmp    1344 <HTML_LatLongWrite+0x1b4>
jmp    12de <HTML_LatLongWrite+0x14e>
add    $0x700,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTML_LatLongWrite>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x6f0,%rsp
movsd  %xmm1,0x8(%rsp)
lea    0xe64(%rip),%rbx
lea    0x4f0(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   10a0 <sprintf@plt>
lea    0x2f0(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
movsd  0x8(%rsp),%xmm0
call   10a0 <sprintf@plt>
lea    0xe34(%rip),%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xe45(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xe57(%rip),%rdi
lea    0xe5f(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <feof@plt>
lea    0xe55(%rip),%rsi
lea    0x1b0(%rsp),%r12
mov    $0xc8,%edx
mov    %r12,%rdi
call   1070 <memcpy@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movq   $0x0,0x1a0(%rsp)
movb   $0x2c,0xe0(%rsp)
2c
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0xd0(%rsp)
movl   $0xa202c29,0x10(%rsp)
0a
mov    %r12,%rdi
mov    %r15,%rsi
call   1090 <strcat@plt>
lea    0xe0(%rsp),%rsi
mov    %r12,%rdi
call   1090 <strcat@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1090 <strcat@plt>
lea    0x10(%rsp),%rsi
mov    %r12,%rdi
call   1090 <strcat@plt>
mov    $0x65,%ebp
lea    0x280(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1371 <HTML_LatLongWrite+0x1f1>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
add    $0xffffffff,%ebp
jne    1340 <HTML_LatLongWrite+0x1c0>
lea    0x1b0(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
add    $0x6f0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [32 x i8] c"la latitud (string) es: %s N \0A\00"
@.str.2 = [33 x i8] c"la longitud (string) es: %s W \0A\00"
@.str.3 = [15 x i8] c"main_html.html\00"
@.str.4 = [3 x i8] c"r+\00"
@__const.HTML_LatLongWrite.cadena1 = [200 x i8] c"center: new google.maps.LatLng( \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @HTML_LatLongWrite(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca [500 x i8]
%6 = alloca [500 x i8]
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [100 x i8]
%11 = alloca [200 x i8]
%12 = alloca [200 x i8]
%13 = alloca [200 x i8]
store double %0, double* %3
store double %1, double* %4
%14 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%15 = load double, double* %3
%16 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %15)
%17 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%18 = load double, double* %4
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %18)
%20 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %24, i32** %7
%25 = load i32*, i32** %7
%26 = call i32 @feof(i32* %25)
store i32 %26, i32* %8
store i32 0, i32* %9
%27 = bitcast [200 x i8]* %11 to i8*
%28 = bitcast [200 x i8]* %12 to i8*
%29 = bitcast i8* %28 to [200 x i8]*
%30 = getelementptr inbounds [200 x i8], [200 x i8]* %29, i32 0, i32 0
store i8 44, i8* %30
%31 = bitcast [200 x i8]* %13 to i8*
%32 = bitcast i8* %31 to [200 x i8]*
%33 = getelementptr inbounds [200 x i8], [200 x i8]* %32, i32 0, i32 0
store i8 41, i8* %33
%34 = getelementptr inbounds [200 x i8], [200 x i8]* %32, i32 0, i32 1
store i8 44, i8* %34
%35 = getelementptr inbounds [200 x i8], [200 x i8]* %32, i32 0, i32 2
store i8 32, i8* %35
%36 = getelementptr inbounds [200 x i8], [200 x i8]* %32, i32 0, i32 3
store i8 10, i8* %36
%37 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%38 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%39 = call i32 @strcat(i8* %37, i8* %38)
%40 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%41 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%42 = call i32 @strcat(i8* %40, i8* %41)
%43 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%44 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%45 = call i32 @strcat(i8* %43, i8* %44)
%46 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%47 = getelementptr inbounds [200 x i8], [200 x i8]* %13, i64 0, i64 0
%48 = call i32 @strcat(i8* %46, i8* %47)
br label %49
49: ; preds = %65, %2
%50 = load i32*, i32** %7
%51 = call i32 @feof(i32* %50)
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %66
53: ; preds = %49
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%55 = load i32*, i32** %7
%56 = call i32 @fgets(i8* %54, i32 100, i32* %55)
%57 = load i32, i32* %9
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
%59 = load i32, i32* %9
%60 = icmp eq i32 %59, 101
br i1 %60, label %61, label %65
61: ; preds = %53
%62 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%63 = load i32*, i32** %7
%64 = call i32 @fputs(i8* %62, i32* %63)
br label %66
65: ; preds = %53
br label %49
66: ; preds = %61, %49
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [32 x i8] c"la latitud (string) es: %s N \0A\00"
@.str.2 = [33 x i8] c"la longitud (string) es: %s W \0A\00"
@.str.3 = [15 x i8] c"main_html.html\00"
@.str.4 = [3 x i8] c"r+\00"
@__const.HTML_LatLongWrite.cadena1 = [200 x i8] c"center: new google.maps.LatLng( \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @HTML_LatLongWrite(double %0, double %1) {
%3 = alloca [500 x i8]
%4 = alloca [500 x i8]
%5 = alloca [100 x i8]
%6 = alloca [200 x i8]
%7 = alloca [200 x i8]
%8 = alloca [200 x i8]
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%10 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
%11 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%12 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %1)
%13 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%15 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @feof(i32* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
store i8 44, i8* %19
%20 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
store i8 41, i8* %20
%21 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 1
store i8 44, i8* %21
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 2
store i8 32, i8* %22
%23 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 3
store i8 10, i8* %23
%24 = call i32 @strcat(i8* %18, i8* %9)
%25 = call i32 @strcat(i8* %18, i8* %19)
%26 = call i32 @strcat(i8* %18, i8* %11)
%27 = call i32 @strcat(i8* %18, i8* %20)
br label %28
28: ; preds = %32, %2
%29 = phi i32 [ 0, %2 ], [ %34, %32 ]
%30 = call i32 @feof(i32* %15)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = call i32 @fgets(i8* %17, i32 100, i32* %15)
%34 = add nuw nsw i32 %29, 1
%35 = icmp eq i32 %34, 101
br i1 %35, label %36, label %28
36: ; preds = %32
%37 = call i32 @fputs(i8* %18, i32* %15)
br label %38
38: ; preds = %28, %36
ret void
}