void printWeather(char *buff) {
  int len;
  char *str;
  str = strstr(buff, "<full>");
  len = strcspn(str + 6, "<");
  printf("\nLocation: %.*s\n", len, str + 6);
  printf("\nCurrent Weather Conditions");
  str = strstr(buff, "<observation_time>");
  len = strcspn(str + 18, "<");
  printf(" (%.*s):\n\n", len, str + 18);
  str = strstr(buff, "<temperature_string>");
  len = strcspn(str + 20, "<");
  printf("\tTemperature: %.*s", len, str + 20);
  str = strstr(buff, "<weather>");
  len = strcspn(str + 9, "<");
  printf("\n\tWeather: %.*s", len, str + 9);
  str = strstr(buff, "<wind_string>");
  len = strcspn(str + 13, "<");
  printf("\n\tWind: %.*s", len, str + 13);
  str = strstr(buff, "<relative_humidity>");
  len = strcspn(str + 19, "<");
  printf("\n\tHumidity: %.*s", len, str + 19);
  printf("\n\n");
}


x86 assembly (clang, -O0):
<printWeather>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x6,%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x6,%rdx
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x12,%rdi
lea    0xe56(%rip),%rsi
call   1040 <strcspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x12,%rdx
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x14,%rdi
lea    0xe12(%rip),%rsi
call   1040 <strcspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x14,%rdx
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x9,%rdi
lea    0xdce(%rip),%rsi
call   1040 <strcspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x9,%rdx
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe31(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xd,%rdi
lea    0xd8a(%rip),%rsi
call   1040 <strcspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0xd,%rdx
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe08(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x13,%rdi
lea    0xd46(%rip),%rsi
call   1040 <strcspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x13,%rdx
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printWeather>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xeb1(%rip),%rsi
call   1060 <strstr@plt>
lea    0x6(%rax),%rbx
lea    0xea8(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcspn@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea4(%rip),%rsi
mov    %r15,%rdi
call   1060 <strstr@plt>
lea    0x12(%rax),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcspn@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe91(%rip),%rsi
mov    %r15,%rdi
call   1060 <strstr@plt>
lea    0x14(%rax),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcspn@plt>
lea    0xe88(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe88(%rip),%rsi
mov    %r15,%rdi
call   1060 <strstr@plt>
lea    0x9(%rax),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcspn@plt>
lea    0xe74(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe71(%rip),%rsi
mov    %r15,%rdi
call   1060 <strstr@plt>
lea    0xd(%rax),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcspn@plt>
lea    0xe61(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe5b(%rip),%rsi
mov    %r15,%rdi
call   1060 <strstr@plt>
lea    0x13(%rax),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcspn@plt>
lea    0xe51(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdcb(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"<full>\00"
@.str.1 = [2 x i8] c"<\00"
@.str.2 = [17 x i8] c"\0ALocation: %.*s\0A\00"
@.str.3 = [28 x i8] c"\0ACurrent Weather Conditions\00"
@.str.4 = [19 x i8] c"<observation_time>\00"
@.str.5 = [11 x i8] c" (%.*s):\0A\0A\00"
@.str.6 = [21 x i8] c"<temperature_string>\00"
@.str.7 = [19 x i8] c"\09Temperature: %.*s\00"
@.str.8 = [10 x i8] c"<weather>\00"
@.str.9 = [16 x i8] c"\0A\09Weather: %.*s\00"
@.str.10 = [14 x i8] c"<wind_string>\00"
@.str.11 = [13 x i8] c"\0A\09Wind: %.*s\00"
@.str.12 = [20 x i8] c"<relative_humidity>\00"
@.str.13 = [17 x i8] c"\0A\09Humidity: %.*s\00"
@.str.14 = [3 x i8] c"\0A\0A\00"
define void @printWeather(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 6
%9 = call i64 @strcspn(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %11, i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%16 = load i8*, i8** %2
%17 = call i8* @strstr(i8* %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i8* %17, i8** %4
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 18
%20 = call i64 @strcspn(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 18
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %22, i8* %24)
%26 = load i8*, i8** %2
%27 = call i8* @strstr(i8* %26, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
store i8* %27, i8** %4
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 20
%30 = call i64 @strcspn(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = trunc i64 %30 to i32
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i64 20
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %32, i8* %34)
%36 = load i8*, i8** %2
%37 = call i8* @strstr(i8* %36, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
store i8* %37, i8** %4
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i64 9
%40 = call i64 @strcspn(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%41 = trunc i64 %40 to i32
store i32 %41, i32* %3
%42 = load i32, i32* %3
%43 = load i8*, i8** %4
%44 = getelementptr inbounds i8, i8* %43, i64 9
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %42, i8* %44)
%46 = load i8*, i8** %2
%47 = call i8* @strstr(i8* %46, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
store i8* %47, i8** %4
%48 = load i8*, i8** %4
%49 = getelementptr inbounds i8, i8* %48, i64 13
%50 = call i64 @strcspn(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%51 = trunc i64 %50 to i32
store i32 %51, i32* %3
%52 = load i32, i32* %3
%53 = load i8*, i8** %4
%54 = getelementptr inbounds i8, i8* %53, i64 13
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %52, i8* %54)
%56 = load i8*, i8** %2
%57 = call i8* @strstr(i8* %56, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
store i8* %57, i8** %4
%58 = load i8*, i8** %4
%59 = getelementptr inbounds i8, i8* %58, i64 19
%60 = call i64 @strcspn(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%61 = trunc i64 %60 to i32
store i32 %61, i32* %3
%62 = load i32, i32* %3
%63 = load i8*, i8** %4
%64 = getelementptr inbounds i8, i8* %63, i64 19
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), i32 %62, i8* %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"<full>\00"
@.str.1 = [2 x i8] c"<\00"
@.str.2 = [17 x i8] c"\0ALocation: %.*s\0A\00"
@.str.3 = [28 x i8] c"\0ACurrent Weather Conditions\00"
@.str.4 = [19 x i8] c"<observation_time>\00"
@.str.5 = [11 x i8] c" (%.*s):\0A\0A\00"
@.str.6 = [21 x i8] c"<temperature_string>\00"
@.str.7 = [19 x i8] c"\09Temperature: %.*s\00"
@.str.8 = [10 x i8] c"<weather>\00"
@.str.9 = [16 x i8] c"\0A\09Weather: %.*s\00"
@.str.10 = [14 x i8] c"<wind_string>\00"
@.str.11 = [13 x i8] c"\0A\09Wind: %.*s\00"
@.str.12 = [20 x i8] c"<relative_humidity>\00"
@.str.13 = [17 x i8] c"\0A\09Humidity: %.*s\00"
@str = [2 x i8] c"\0A\00"
define void @printWeather(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %2, i64 6
%4 = tail call i64 @strcspn(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = trunc i64 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %5, i8* %3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%9 = getelementptr inbounds i8, i8* %8, i64 18
%10 = tail call i64 @strcspn(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = trunc i64 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %11, i8* %9)
%13 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%14 = getelementptr inbounds i8, i8* %13, i64 20
%15 = tail call i64 @strcspn(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = trunc i64 %15 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %16, i8* %14)
%18 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%19 = getelementptr inbounds i8, i8* %18, i64 9
%20 = tail call i64 @strcspn(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = trunc i64 %20 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %21, i8* %19)
%23 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%24 = getelementptr inbounds i8, i8* %23, i64 13
%25 = tail call i64 @strcspn(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%26 = trunc i64 %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %26, i8* %24)
%28 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
%29 = getelementptr inbounds i8, i8* %28, i64 19
%30 = tail call i64 @strcspn(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = trunc i64 %30 to i32
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), i32 %31, i8* %29)
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}