float find_longitude(char filename[200]) {
  int i;
  char name[200];
  char junk[25];
  float return_lon;
  strcpy(name, filename);
  for (i = 0; i < ((strlen(filename)) - 1); i++) {
    if (name[i] == '_')
      name[i] = ' ';
  }
  sscanf(name, "%s %s %f", junk, junk, &return_lon);
  return return_lon;
}


x86 assembly (clang, -O0):
<find_longitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x110(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x110(%rbp),%rax
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    11b5 <find_longitude+0x85>
movslq -0xc(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    $0x5f,%eax
jne    11a2 <find_longitude+0x72>
movslq -0xc(%rbp),%rax
movb   $0x20,-0xe0(%rbp,%rax,1)
20
jmp    11a7 <find_longitude+0x77>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <find_longitude+0x26>
lea    -0xe0(%rbp),%rdi
lea    -0x100(%rbp),%rdx
lea    -0x100(%rbp),%rcx
lea    0xe2f(%rip),%rsi
lea    -0x104(%rbp),%r8
mov    $0x0,%al
call   1050 <sscanf@plt>
movss  -0x104(%rbp),%xmm0
ff
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_longitude>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xffffffffffffffff,%rax
je     133f <find_longitude+0x20f>
cmp    $0x10,%rax
jae    1167 <find_longitude+0x37>
xor    %ecx,%ecx
jmp    132d <find_longitude+0x1fd>
mov    %rax,%rcx
and    $0xfffffffffffffff0,%rcx
xor    %edx,%edx
movdqa 0xe88(%rip),%xmm0
movdqa 0xe90(%rip),%xmm1
jmp    119d <find_longitude+0x6d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x10,%rdx
cmp    %rdx,%rcx
je     1328 <find_longitude+0x1f8>
movq   0x10(%rsp,%rdx,1),%xmm3
movdqa %xmm3,%xmm2
pcmpeqb %xmm0,%xmm2
movd   %xmm2,%esi
test   $0x1,%sil
je     11ba <find_longitude+0x8a>
movb   $0x20,0x10(%rsp,%rdx,1)
movdqa %xmm2,%xmm4
pslld  $0x8,%xmm4
movd   %xmm4,%esi
shr    $0x10,%esi
test   $0x1,%sil
je     11d5 <find_longitude+0xa5>
movb   $0x20,0x11(%rsp,%rdx,1)
pshuflw $0x55,%xmm3,%xmm4
pcmpeqb %xmm0,%xmm4
pextrw $0x2,%xmm4,%esi
test   $0x1,%sil
je     11ee <find_longitude+0xbe>
movb   $0x20,0x12(%rsp,%rdx,1)
movdqa %xmm2,%xmm4
psllq  $0x18,%xmm4
pextrw $0x3,%xmm4,%esi
test   $0x1,%sil
je     1207 <find_longitude+0xd7>
movb   $0x20,0x13(%rsp,%rdx,1)
pshufd $0x55,%xmm3,%xmm3
pcmpeqb %xmm1,%xmm3
pextrw $0x4,%xmm3,%esi
test   $0x1,%sil
je     1220 <find_longitude+0xf0>
movb   $0x20,0x14(%rsp,%rdx,1)
movdqa %xmm2,%xmm3
pslldq $0x5,%xmm3
pextrw $0x5,%xmm3,%esi
test   $0x1,%sil
je     1239 <find_longitude+0x109>
movb   $0x20,0x15(%rsp,%rdx,1)
pextrw $0x3,%xmm2,%esi
test   $0x1,%sil
je     1249 <find_longitude+0x119>
movb   $0x20,0x16(%rsp,%rdx,1)
pslldq $0x7,%xmm2
pextrw $0x7,%xmm2,%esi
test   $0x1,%sil
je     125e <find_longitude+0x12e>
movb   $0x20,0x17(%rsp,%rdx,1)
movq   0x18(%rsp,%rdx,1),%xmm3
movdqa %xmm3,%xmm2
pcmpeqb %xmm0,%xmm2
movd   %xmm2,%esi
test   $0x1,%sil
je     127b <find_longitude+0x14b>
movb   $0x20,0x18(%rsp,%rdx,1)
movdqa %xmm2,%xmm4
pslld  $0x8,%xmm4
movd   %xmm4,%esi
shr    $0x10,%esi
test   $0x1,%sil
je     1296 <find_longitude+0x166>
movb   $0x20,0x19(%rsp,%rdx,1)
pshuflw $0x55,%xmm3,%xmm4
pcmpeqb %xmm0,%xmm4
pextrw $0x2,%xmm4,%esi
test   $0x1,%sil
je     12af <find_longitude+0x17f>
movb   $0x20,0x1a(%rsp,%rdx,1)
movdqa %xmm2,%xmm4
psllq  $0x18,%xmm4
pextrw $0x3,%xmm4,%esi
test   $0x1,%sil
je     12c8 <find_longitude+0x198>
movb   $0x20,0x1b(%rsp,%rdx,1)
pshufd $0x55,%xmm3,%xmm3
pcmpeqb %xmm1,%xmm3
pextrw $0x4,%xmm3,%esi
test   $0x1,%sil
je     12e1 <find_longitude+0x1b1>
movb   $0x20,0x1c(%rsp,%rdx,1)
movdqa %xmm2,%xmm3
pslldq $0x5,%xmm3
pextrw $0x5,%xmm3,%esi
test   $0x1,%sil
je     12fa <find_longitude+0x1ca>
movb   $0x20,0x1d(%rsp,%rdx,1)
pextrw $0x3,%xmm2,%esi
test   $0x1,%sil
je     130a <find_longitude+0x1da>
movb   $0x20,0x1e(%rsp,%rdx,1)
pslldq $0x7,%xmm2
pextrw $0x7,%xmm2,%esi
test   $0x1,%sil
je     1190 <find_longitude+0x60>
movb   $0x20,0x1f(%rsp,%rdx,1)
jmp    1190 <find_longitude+0x60>
cmp    %rcx,%rax
je     133f <find_longitude+0x20f>
cmpb   $0x5f,0x10(%rsp,%rcx,1)
jne    1339 <find_longitude+0x209>
movb   $0x20,0x10(%rsp,%rcx,1)
add    $0x1,%rcx
jmp    1328 <find_longitude+0x1f8>
lea    0xcda(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0xe0(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    %rcx,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
movss  0xc(%rsp),%xmm0
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s %s %f\00"
define float @find_longitude(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [200 x i8]
%5 = alloca [25 x i8]
%6 = alloca float
store i8* %0, i8** %2
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i8* %7, i8* %8)
store i32 0, i32* %3
br label %10
10: ; preds = %29, %1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = load i8*, i8** %2
%14 = call i64 @strlen(i8* %13)
%15 = sub i64 %14, 1
%16 = icmp ult i64 %12, %15
br i1 %16, label %17, label %32
17: ; preds = %10
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 95
br i1 %23, label %24, label %28
24: ; preds = %17
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %26
store i8 32, i8* %27
br label %28
28: ; preds = %24, %17
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %10
32: ; preds = %10
%33 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%34 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
%35 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
%36 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %34, i8* %35, float* %6)
%37 = load float, float* %6
ret float %37
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s %s %f\00"
define float @find_longitude(i8* nocapture %0) {
%2 = alloca [200 x i8]
%3 = alloca [25 x i8]
%4 = alloca float
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%7 = bitcast float* %4 to i8*
%8 = call i8* @strcpy(i8* %5, i8* dereferenceable(1) %0)
%9 = call i64 @strlen(i8* dereferenceable(1) %0)
%10 = add i64 %9, -1
%11 = icmp eq i64 %10, 0
br i1 %11, label %120, label %12
12: ; preds = %1
%13 = icmp ult i64 %10, 16
br i1 %13, label %109, label %14
14: ; preds = %12
%15 = and i64 %10, -16
br label %16
16: ; preds = %104, %14
%17 = phi i64 [ 0, %14 ], [ %105, %104 ]
%18 = or i64 %17, 8
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %17
%20 = bitcast i8* %19 to <8 x i8>*
%21 = load <8 x i8>, <8 x i8>* %20
%22 = getelementptr inbounds i8, i8* %19, i64 8
%23 = bitcast i8* %22 to <8 x i8>*
%24 = load <8 x i8>, <8 x i8>* %23
%25 = icmp eq <8 x i8> %21, <i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95>
%26 = icmp eq <8 x i8> %24, <i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95>
%27 = extractelement <8 x i1> %25, i64 0
br i1 %27, label %28, label %30
28: ; preds = %16
%29 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %17
store i8 32, i8* %29
br label %30
30: ; preds = %28, %16
%31 = extractelement <8 x i1> %25, i64 1
br i1 %31, label %32, label %35
32: ; preds = %30
%33 = or i64 %17, 1
%34 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %33
store i8 32, i8* %34
br label %35
35: ; preds = %32, %30
%36 = extractelement <8 x i1> %25, i64 2
br i1 %36, label %37, label %40
37: ; preds = %35
%38 = or i64 %17, 2
%39 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %38
store i8 32, i8* %39
br label %40
40: ; preds = %37, %35
%41 = extractelement <8 x i1> %25, i64 3
br i1 %41, label %42, label %45
42: ; preds = %40
%43 = or i64 %17, 3
%44 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %43
store i8 32, i8* %44
br label %45
45: ; preds = %42, %40
%46 = extractelement <8 x i1> %25, i64 4
br i1 %46, label %47, label %50
47: ; preds = %45
%48 = or i64 %17, 4
%49 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %48
store i8 32, i8* %49
br label %50
50: ; preds = %47, %45
%51 = extractelement <8 x i1> %25, i64 5
br i1 %51, label %52, label %55
52: ; preds = %50
%53 = or i64 %17, 5
%54 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %53
store i8 32, i8* %54
br label %55
55: ; preds = %52, %50
%56 = extractelement <8 x i1> %25, i64 6
br i1 %56, label %57, label %60
57: ; preds = %55
%58 = or i64 %17, 6
%59 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %58
store i8 32, i8* %59
br label %60
60: ; preds = %57, %55
%61 = extractelement <8 x i1> %25, i64 7
br i1 %61, label %62, label %65
62: ; preds = %60
%63 = or i64 %17, 7
%64 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %63
store i8 32, i8* %64
br label %65
65: ; preds = %62, %60
%66 = extractelement <8 x i1> %26, i64 0
br i1 %66, label %67, label %69
67: ; preds = %65
%68 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %18
store i8 32, i8* %68
br label %69
69: ; preds = %67, %65
%70 = extractelement <8 x i1> %26, i64 1
br i1 %70, label %71, label %74
71: ; preds = %69
%72 = or i64 %17, 9
%73 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %72
store i8 32, i8* %73
br label %74
74: ; preds = %71, %69
%75 = extractelement <8 x i1> %26, i64 2
br i1 %75, label %76, label %79
76: ; preds = %74
%77 = or i64 %17, 10
%78 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %77
store i8 32, i8* %78
br label %79
79: ; preds = %76, %74
%80 = extractelement <8 x i1> %26, i64 3
br i1 %80, label %81, label %84
81: ; preds = %79
%82 = or i64 %17, 11
%83 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %82
store i8 32, i8* %83
br label %84
84: ; preds = %81, %79
%85 = extractelement <8 x i1> %26, i64 4
br i1 %85, label %86, label %89
86: ; preds = %84
%87 = or i64 %17, 12
%88 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %87
store i8 32, i8* %88
br label %89
89: ; preds = %86, %84
%90 = extractelement <8 x i1> %26, i64 5
br i1 %90, label %91, label %94
91: ; preds = %89
%92 = or i64 %17, 13
%93 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %92
store i8 32, i8* %93
br label %94
94: ; preds = %91, %89
%95 = extractelement <8 x i1> %26, i64 6
br i1 %95, label %96, label %99
96: ; preds = %94
%97 = or i64 %17, 14
%98 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %97
store i8 32, i8* %98
br label %99
99: ; preds = %96, %94
%100 = extractelement <8 x i1> %26, i64 7
br i1 %100, label %101, label %104
101: ; preds = %99
%102 = or i64 %17, 15
%103 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %102
store i8 32, i8* %103
br label %104
104: ; preds = %101, %99
%105 = add nuw i64 %17, 16
%106 = icmp eq i64 %105, %15
br i1 %106, label %107, label %16
107: ; preds = %104
%108 = icmp eq i64 %10, %15
br i1 %108, label %120, label %109
109: ; preds = %12, %107
%110 = phi i64 [ 0, %12 ], [ %15, %107 ]
br label %111
111: ; preds = %109, %117
%112 = phi i64 [ %118, %117 ], [ %110, %109 ]
%113 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = icmp eq i8 %114, 95
br i1 %115, label %116, label %117
116: ; preds = %111
store i8 32, i8* %113
br label %117
117: ; preds = %111, %116
%118 = add nuw nsw i64 %112, 1
%119 = icmp eq i64 %118, %10
br i1 %119, label %120, label %111
120: ; preds = %117, %107, %1
%121 = call i32 (i8*, i8*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %6, float* %4)
%122 = load float, float* %4
ret float %122
}