#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *strchr(char *, char);
double Read_latGPS(int lat_out) {
  char command[500] =
      "head -50 /dev/ttyO2 > ~/Desktop/jorgedatosgpsnuevoparquevean.txt";
  FILE *TestConsole = popen(command, "w");
  fclose(TestConsole);
  printf("...Se hiso el cat..\n");
  char command1[500] =
      " grep '$GPGLL' ~/Desktop/jorgedatosgpsnuevoparquevean.txt > "
      "~/Desktop/jorgelatlong.txt";
  FILE *TestConsole1 = popen(command1, "w");
  fclose(TestConsole);
  printf("...Se hiZo el grep...\n");
  FILE *in;
  in = fopen("jorgelatlong.txt", "r+");
  char latlong[200];
  int length = 0;
  fgets(latlong, 100, in);
  printf("... ya se guardó la primera línea...\n");
  char *s;
  int valido = 0;
  int c = 0;
  s = strchr(latlong, 'V');
  if (s != NULL) {
    printf("......found a 'V' at .......%s\n", s);
    valido = 0;
  } else {
    printf(".....not found 'V' el dato es válido.........\n");
    valido = 1;
  }
  c = fgetc(in);
  c = fgetc(in);
  c = fgetc(in);
  c = fgetc(in);
  c = fgetc(in);
  c = fgetc(in);
  c = fgetc(in);
  int g1N, g2N, m1N, m2N, m3N, m4N, m5N, m6N;
  int gN = 0;
  int mN = 0;
  int norte = 0;
  g1N = fgetc(in);
  g2N = fgetc(in);
  m1N = fgetc(in);
  m2N = fgetc(in);
  c = fgetc(in);
  m3N = fgetc(in);
  m4N = fgetc(in);
  m5N = fgetc(in);
  m6N = fgetc(in);
  c = fgetc(in);
  norte = fgetc(in);
  c = fgetc(in);
  int g1W, g2W, g3W, m1W, m2W, m3W, m4W, m5W, m6W;
  int gW = 0;
  int mW = 0;
  int west = 0;
  g1W = fgetc(in);
  g2W = fgetc(in);
  g3W = fgetc(in);
  m1W = fgetc(in);
  m2W = fgetc(in);
  c = fgetc(in);
  m3W = fgetc(in);
  m4W = fgetc(in);
  m5W = fgetc(in);
  m6W = fgetc(in);
  c = fgetc(in);
  west = fgetc(in);
  c = fgetc(in);
  printf("El dato norte es : %c %c %c %c . %c %c %c %c \n", g1N, g2N, m1N, m2N,
         m3N, m4N, m5N, m6N);
  printf("El dato oeste es : %c %c %c %c %c . %c %c %c %c \n", g1W, g2W, g3W,
         m1W, m2W, m3W, m4W, m5W, m6W);
  double latitud = 28.535219;
  double longitud = (-1) * 81.382456;
  printf("la latitud es: %f  N \n", latitud);
  printf("la longitud es: %f  W \n", longitud);
  char str_latitud[500];
  sprintf(str_latitud, "%f", latitud);
  char str_longitud[500];
  sprintf(str_longitud, "%f", longitud);
  printf("la latitud (string) es: %s  N \n", str_latitud);
  printf("la longitud (string) es: %s  W \n", str_longitud);
  if (lat_out == 1) {
    return latitud;
  } else {
    return longitud;
  }
}


x86 assembly (clang, -O0):
<Read_latGPS>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x988,%rsp
mov    %edi,-0x14(%rbp)
lea    -0x210(%rbp),%rdi
lea    0xe63(%rip),%rsi
mov    $0x1f4,%edx
call   1080 <memcpy@plt>
lea    -0x210(%rbp),%rdi
lea    0x123f(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x218(%rbp)
mov    -0x218(%rbp),%rdi
call   1030 <fclose@plt>
lea    0x1222(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x410(%rbp),%rdi
lea    0x1017(%rip),%rsi
mov    $0x1f4,%edx
call   1080 <memcpy@plt>
lea    -0x410(%rbp),%rdi
lea    0x11f3(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x418(%rbp)
mov    -0x218(%rbp),%rdi
call   1030 <fclose@plt>
lea    0x11eb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x11f4(%rip),%rdi
lea    0x11fe(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x420(%rbp)
movl   $0x0,-0x4f4(%rbp)
lea    -0x4f0(%rbp),%rdi
mov    -0x420(%rbp),%rdx
mov    $0x64,%esi
call   1070 <fgets@plt>
lea    0x11cc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x504(%rbp)
movl   $0x0,-0x508(%rbp)
lea    -0x4f0(%rbp),%rdi
mov    $0x56,%esi
call   1040 <strchr@plt>
mov    %rax,-0x500(%rbp)
cmpq   $0x0,-0x500(%rbp)
je     12df <Read_latGPS+0x14f>
mov    -0x500(%rbp),%rsi
lea    0x11a5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x504(%rbp)
jmp    12f7 <Read_latGPS+0x167>
lea    0x11a8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x504(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
movl   $0x0,-0x52c(%rbp)
movl   $0x0,-0x530(%rbp)
movl   $0x0,-0x534(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x50c(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x510(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x514(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x518(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x51c(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x520(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x524(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x528(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x534(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
movl   $0x0,-0x55c(%rbp)
movl   $0x0,-0x560(%rbp)
movl   $0x0,-0x564(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x538(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x53c(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x540(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x544(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x548(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x54c(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x550(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x554(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x558(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x564(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x508(%rbp)
mov    -0x50c(%rbp),%esi
mov    -0x510(%rbp),%edx
mov    -0x514(%rbp),%ecx
mov    -0x518(%rbp),%r8d
mov    -0x51c(%rbp),%r9d
mov    -0x520(%rbp),%r11d
mov    -0x524(%rbp),%r10d
mov    -0x528(%rbp),%eax
lea    0xf10(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x538(%rbp),%esi
mov    -0x53c(%rbp),%edx
mov    -0x540(%rbp),%ecx
mov    -0x544(%rbp),%r8d
mov    -0x548(%rbp),%r9d
mov    -0x54c(%rbp),%ebx
mov    -0x550(%rbp),%r11d
mov    -0x554(%rbp),%r10d
mov    -0x558(%rbp),%eax
lea    0xeea(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
movsd  0x9e5(%rip),%xmm0
movsd  %xmm0,-0x570(%rbp)
ff
movsd  0x9cd(%rip),%xmm0
movsd  %xmm0,-0x578(%rbp)
ff
movsd  -0x570(%rbp),%xmm0
ff
lea    0xed5(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x578(%rbp),%xmm0
ff
lea    0xed6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    -0x770(%rbp),%rdi
movsd  -0x570(%rbp),%xmm0
ff
lea    0xed1(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x970(%rbp),%rdi
movsd  -0x578(%rbp),%xmm0
ff
lea    0xeb6(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x770(%rbp),%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x970(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    16e3 <Read_latGPS+0x553>
movsd  -0x570(%rbp),%xmm0
ff
movsd  %xmm0,-0x10(%rbp)
jmp    16f0 <Read_latGPS+0x560>
movsd  -0x578(%rbp),%xmm0
ff
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x988,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_latGPS>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x908,%rsp
mov    %edi,0x24(%rsp)
lea    0xe54(%rip),%rsi
lea    0x710(%rsp),%rbx
mov    $0x1f4,%edx
mov    %rbx,%rdi
call   1090 <memcpy@plt>
lea    0x122c(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <popen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <fclose@plt>
lea    0x1319(%rip),%rdi
call   1030 <puts@plt>
lea    0x100f(%rip),%rsi
lea    0x510(%rsp),%rbp
mov    $0x1f4,%edx
mov    %rbp,%rdi
call   1090 <memcpy@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   10a0 <popen@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x12f2(%rip),%rdi
call   1030 <puts@plt>
lea    0x11ca(%rip),%rdi
lea    0x11d4(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x64,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
lea    0x12d1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
mov    $0x56,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1291 <Read_latGPS+0xf1>
lea    0x1195(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    129d <Read_latGPS+0xfd>
lea    0x12c7(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0x20(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0x1c(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0x18(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0x14(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0x10(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rax,0x38(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rax,0x30(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rax,0x28(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,0x4(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,(%rsp)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
sub    $0x8,%rsp
lea    0x1052(%rip),%rdi
mov    0x28(%rsp),%esi
mov    0x24(%rsp),%edx
mov    0x20(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x18(%rsp),%r9d
xor    %eax,%eax
push   0x30(%rsp)
push   0x40(%rsp)
push   0x50(%rsp)
call   1060 <printf@plt>
add    $0x20,%rsp
lea    0x104d(%rip),%rdi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
mov    %ebp,%r9d
xor    %eax,%eax
push   %r12
push   %r15
push   %r14
push   %r13
call   1060 <printf@plt>
add    $0x20,%rsp
lea    0x1052(%rip),%rdi
movsd  0xbaf(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
lea    0x1053(%rip),%rdi
movsd  0xba1(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
lea    0x1055(%rip),%rbx
lea    0x310(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
movsd  0xb75(%rip),%xmm0
call   10c0 <sprintf@plt>
lea    0x110(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
movsd  0xb62(%rip),%xmm0
call   10c0 <sprintf@plt>
lea    0x101b(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x102a(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movsd  0xb2b(%rip),%xmm0
cmpl   $0x1,0x24(%rsp)
je     14e4 <Read_latGPS+0x344>
movsd  0xb24(%rip),%xmm0
add    $0x908,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.Read_latGPS.command = [500 x i8] c"head -50 /dev/ttyO2 > ~/Desktop/jorgedatosgpsnuevoparquevean.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [21 x i8] c"...Se hiso el cat..\0A\00"
@__const.Read_latGPS.command1 = [500 x i8] c" grep '$GPGLL' ~/Desktop/jorgedatosgpsnuevoparquevean.txt > ~/Desktop/jorgelatlong.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.2 = [23 x i8] c"...Se hiZo el grep...\0A\00"
@.str.3 = [17 x i8] c"jorgelatlong.txt\00"
@.str.4 = [3 x i8] c"r+\00"
@.str.5 = [40 x i8] c"... ya se guard\C3\B3 la primera l\C3\ADnea...\0A\00"
@.str.6 = [32 x i8] c"......found a 'V' at .......%s\0A\00"
@.str.7 = [48 x i8] c".....not found 'V' el dato es v\C3\A1lido.........\0A\00"
@.str.8 = [47 x i8] c"El dato norte es : %c %c %c %c . %c %c %c %c \0A\00"
@.str.9 = [50 x i8] c"El dato oeste es : %c %c %c %c %c . %c %c %c %c \0A\00"
@.str.10 = [23 x i8] c"la latitud es: %f N \0A\00"
@.str.11 = [24 x i8] c"la longitud es: %f W \0A\00"
@.str.12 = [3 x i8] c"%f\00"
@.str.13 = [32 x i8] c"la latitud (string) es: %s N \0A\00"
@.str.14 = [33 x i8] c"la longitud (string) es: %s W \0A\00"
define double @Read_latGPS(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca [500 x i8]
%5 = alloca i32*
%6 = alloca [500 x i8]
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [200 x i8]
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca double
%38 = alloca double
%39 = alloca [500 x i8]
%40 = alloca [500 x i8]
store i32 %0, i32* %3
%41 = bitcast [500 x i8]* %4 to i8*
%42 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%43 = call i32* @popen(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %43, i32** %5
%44 = load i32*, i32** %5
%45 = call i32 @fclose(i32* %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%47 = bitcast [500 x i8]* %6 to i8*
%48 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%49 = call i32* @popen(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %49, i32** %7
%50 = load i32*, i32** %5
%51 = call i32 @fclose(i32* %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%53 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 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* %53, i32** %8
store i32 0, i32* %10
%54 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%55 = load i32*, i32** %8
%56 = call i32 @fgets(i8* %54, i32 100, i32* %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %12
store i32 0, i32* %13
%58 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%59 = call i8* @strchr(i8* %58, i8 signext 86)
store i8* %59, i8** %11
%60 = load i8*, i8** %11
%61 = icmp ne i8* %60, null
br i1 %61, label %62, label %65
62: ; preds = %1
%63 = load i8*, i8** %11
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %63)
store i32 0, i32* %12
br label %67
65: ; preds = %1
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %12
br label %67
67: ; preds = %65, %62
%68 = load i32*, i32** %8
%69 = call i32 @fgetc(i32* %68)
store i32 %69, i32* %13
%70 = load i32*, i32** %8
%71 = call i32 @fgetc(i32* %70)
store i32 %71, i32* %13
%72 = load i32*, i32** %8
%73 = call i32 @fgetc(i32* %72)
store i32 %73, i32* %13
%74 = load i32*, i32** %8
%75 = call i32 @fgetc(i32* %74)
store i32 %75, i32* %13
%76 = load i32*, i32** %8
%77 = call i32 @fgetc(i32* %76)
store i32 %77, i32* %13
%78 = load i32*, i32** %8
%79 = call i32 @fgetc(i32* %78)
store i32 %79, i32* %13
%80 = load i32*, i32** %8
%81 = call i32 @fgetc(i32* %80)
store i32 %81, i32* %13
store i32 0, i32* %22
store i32 0, i32* %23
store i32 0, i32* %24
%82 = load i32*, i32** %8
%83 = call i32 @fgetc(i32* %82)
store i32 %83, i32* %14
%84 = load i32*, i32** %8
%85 = call i32 @fgetc(i32* %84)
store i32 %85, i32* %15
%86 = load i32*, i32** %8
%87 = call i32 @fgetc(i32* %86)
store i32 %87, i32* %16
%88 = load i32*, i32** %8
%89 = call i32 @fgetc(i32* %88)
store i32 %89, i32* %17
%90 = load i32*, i32** %8
%91 = call i32 @fgetc(i32* %90)
store i32 %91, i32* %13
%92 = load i32*, i32** %8
%93 = call i32 @fgetc(i32* %92)
store i32 %93, i32* %18
%94 = load i32*, i32** %8
%95 = call i32 @fgetc(i32* %94)
store i32 %95, i32* %19
%96 = load i32*, i32** %8
%97 = call i32 @fgetc(i32* %96)
store i32 %97, i32* %20
%98 = load i32*, i32** %8
%99 = call i32 @fgetc(i32* %98)
store i32 %99, i32* %21
%100 = load i32*, i32** %8
%101 = call i32 @fgetc(i32* %100)
store i32 %101, i32* %13
%102 = load i32*, i32** %8
%103 = call i32 @fgetc(i32* %102)
store i32 %103, i32* %24
%104 = load i32*, i32** %8
%105 = call i32 @fgetc(i32* %104)
store i32 %105, i32* %13
store i32 0, i32* %34
store i32 0, i32* %35
store i32 0, i32* %36
%106 = load i32*, i32** %8
%107 = call i32 @fgetc(i32* %106)
store i32 %107, i32* %25
%108 = load i32*, i32** %8
%109 = call i32 @fgetc(i32* %108)
store i32 %109, i32* %26
%110 = load i32*, i32** %8
%111 = call i32 @fgetc(i32* %110)
store i32 %111, i32* %27
%112 = load i32*, i32** %8
%113 = call i32 @fgetc(i32* %112)
store i32 %113, i32* %28
%114 = load i32*, i32** %8
%115 = call i32 @fgetc(i32* %114)
store i32 %115, i32* %29
%116 = load i32*, i32** %8
%117 = call i32 @fgetc(i32* %116)
store i32 %117, i32* %13
%118 = load i32*, i32** %8
%119 = call i32 @fgetc(i32* %118)
store i32 %119, i32* %30
%120 = load i32*, i32** %8
%121 = call i32 @fgetc(i32* %120)
store i32 %121, i32* %31
%122 = load i32*, i32** %8
%123 = call i32 @fgetc(i32* %122)
store i32 %123, i32* %32
%124 = load i32*, i32** %8
%125 = call i32 @fgetc(i32* %124)
store i32 %125, i32* %33
%126 = load i32*, i32** %8
%127 = call i32 @fgetc(i32* %126)
store i32 %127, i32* %13
%128 = load i32*, i32** %8
%129 = call i32 @fgetc(i32* %128)
store i32 %129, i32* %36
%130 = load i32*, i32** %8
%131 = call i32 @fgetc(i32* %130)
store i32 %131, i32* %13
%132 = load i32, i32* %14
%133 = load i32, i32* %15
%134 = load i32, i32* %16
%135 = load i32, i32* %17
%136 = load i32, i32* %18
%137 = load i32, i32* %19
%138 = load i32, i32* %20
%139 = load i32, i32* %21
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 %132, i32 %133, i32 %134, i32 %135, i32 %136, i32 %137, i32 %138, i32 %139)
%141 = load i32, i32* %25
%142 = load i32, i32* %26
%143 = load i32, i32* %27
%144 = load i32, i32* %28
%145 = load i32, i32* %29
%146 = load i32, i32* %30
%147 = load i32, i32* %31
%148 = load i32, i32* %32
%149 = load i32, i32* %33
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0), i32 %141, i32 %142, i32 %143, i32 %144, i32 %145, i32 %146, i32 %147, i32 %148, i32 %149)
store double 0x403C89041CC532A5, double* %37
store double 0xC054587A28BB0A2D, double* %38
%151 = load double, double* %37
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), double %151)
%153 = load double, double* %38
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), double %153)
%155 = getelementptr inbounds [500 x i8], [500 x i8]* %39, i64 0, i64 0
%156 = load double, double* %37
%157 = call i32 @sprintf(i8* %155, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), double %156)
%158 = getelementptr inbounds [500 x i8], [500 x i8]* %40, i64 0, i64 0
%159 = load double, double* %38
%160 = call i32 @sprintf(i8* %158, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), double %159)
%161 = getelementptr inbounds [500 x i8], [500 x i8]* %39, i64 0, i64 0
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), i8* %161)
%163 = getelementptr inbounds [500 x i8], [500 x i8]* %40, i64 0, i64 0
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0), i8* %163)
%165 = load i32, i32* %3
%166 = icmp eq i32 %165, 1
br i1 %166, label %167, label %169
167: ; preds = %67
%168 = load double, double* %37
store double %168, double* %2
br label %171
169: ; preds = %67
%170 = load double, double* %38
store double %170, double* %2
br label %171
171: ; preds = %169, %167
%172 = load double, double* %2
ret double %172
}

LLVM IR (-O2):
@__const.Read_latGPS.command = [500 x i8] c"head -50 /dev/ttyO2 > ~/Desktop/jorgedatosgpsnuevoparquevean.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"w\00"
@__const.Read_latGPS.command1 = [500 x i8] c" grep '$GPGLL' ~/Desktop/jorgedatosgpsnuevoparquevean.txt > ~/Desktop/jorgelatlong.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.3 = [17 x i8] c"jorgelatlong.txt\00"
@.str.4 = [3 x i8] c"r+\00"
@.str.6 = [32 x i8] c"......found a 'V' at .......%s\0A\00"
@.str.8 = [47 x i8] c"El dato norte es : %c %c %c %c . %c %c %c %c \0A\00"
@.str.9 = [50 x i8] c"El dato oeste es : %c %c %c %c %c . %c %c %c %c \0A\00"
@.str.10 = [23 x i8] c"la latitud es: %f N \0A\00"
@.str.11 = [24 x i8] c"la longitud es: %f W \0A\00"
@.str.12 = [3 x i8] c"%f\00"
@.str.13 = [32 x i8] c"la latitud (string) es: %s N \0A\00"
@.str.14 = [33 x i8] c"la longitud (string) es: %s W \0A\00"
@str = [20 x i8] c"...Se hiso el cat..\00"
@str.15 = [22 x i8] c"...Se hiZo el grep...\00"
@str.16 = [39 x i8] c"... ya se guard\C3\B3 la primera l\C3\ADnea...\00"
@str.17 = [47 x i8] c".....not found 'V' el dato es v\C3\A1lido.........\00"
define double @Read_latGPS(i32 %0) {
%2 = alloca [500 x i8]
%3 = alloca [500 x i8]
%4 = alloca [200 x i8]
%5 = alloca [500 x i8]
%6 = alloca [500 x i8]
%7 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%8 = call i32* @popen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @fclose(i32* %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%11 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%12 = call i32* @popen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @fclose(i32* %8)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.15, i64 0, i64 0))
%15 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%17 = call i32 @fgets(i8* %16, i32 100, i32* %15)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.16, i64 0, i64 0))
%19 = call i8* @strchr(i8* %16, i8 signext 86)
%20 = icmp eq i8* %19, null
br i1 %20, label %23, label %21
21: ; preds = %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %19)
br label %25
23: ; preds = %1
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.17, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = call i32 @fgetc(i32* %15)
%27 = call i32 @fgetc(i32* %15)
%28 = call i32 @fgetc(i32* %15)
%29 = call i32 @fgetc(i32* %15)
%30 = call i32 @fgetc(i32* %15)
%31 = call i32 @fgetc(i32* %15)
%32 = call i32 @fgetc(i32* %15)
%33 = call i32 @fgetc(i32* %15)
%34 = call i32 @fgetc(i32* %15)
%35 = call i32 @fgetc(i32* %15)
%36 = call i32 @fgetc(i32* %15)
%37 = call i32 @fgetc(i32* %15)
%38 = call i32 @fgetc(i32* %15)
%39 = call i32 @fgetc(i32* %15)
%40 = call i32 @fgetc(i32* %15)
%41 = call i32 @fgetc(i32* %15)
%42 = call i32 @fgetc(i32* %15)
%43 = call i32 @fgetc(i32* %15)
%44 = call i32 @fgetc(i32* %15)
%45 = call i32 @fgetc(i32* %15)
%46 = call i32 @fgetc(i32* %15)
%47 = call i32 @fgetc(i32* %15)
%48 = call i32 @fgetc(i32* %15)
%49 = call i32 @fgetc(i32* %15)
%50 = call i32 @fgetc(i32* %15)
%51 = call i32 @fgetc(i32* %15)
%52 = call i32 @fgetc(i32* %15)
%53 = call i32 @fgetc(i32* %15)
%54 = call i32 @fgetc(i32* %15)
%55 = call i32 @fgetc(i32* %15)
%56 = call i32 @fgetc(i32* %15)
%57 = call i32 @fgetc(i32* %15)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 %33, i32 %34, i32 %35, i32 %36, i32 %38, i32 %39, i32 %40, i32 %41)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0), i32 %45, i32 %46, i32 %47, i32 %48, i32 %49, i32 %51, i32 %52, i32 %53, i32 %54)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), double 0x403C89041CC532A5)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), double 0xC054587A28BB0A2D)
%62 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%63 = call i32 @sprintf(i8* %62, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), double 0x403C89041CC532A5)
%64 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%65 = call i32 @sprintf(i8* %64, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), double 0xC054587A28BB0A2D)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), i8* %62)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0), i8* %64)
%68 = icmp eq i32 %0, 1
%69 = select i1 %68, double 0x403C89041CC532A5, double 0xC054587A28BB0A2D
ret double %69
}