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

/* Variables and functions */
char *alloc_string(char *);
scalar_t__ strstr(char const *, char *);
char *get_real_win(const char *win) {
  if (strstr(win, "10.0"))
    return alloc_string("Windows 10");
  else if (strstr(win, "6.3"))
    return alloc_string("Windows 8.1");
  else if (strstr(win, "6.3; ARM"))
    return alloc_string("Windows RT");
  else if (strstr(win, "6.2; ARM"))
    return alloc_string("Windows RT");
  else if (strstr(win, "6.2"))
    return alloc_string("Windows 8");
  else if (strstr(win, "6.1"))
    return alloc_string("Windows 7");
  else if (strstr(win, "6.0"))
    return alloc_string("Windows Vista");
  else if (strstr(win, "5.2"))
    return alloc_string("Windows XP x64");
  else if (strstr(win, "5.1"))
    return alloc_string("Windows XP");
  else if (strstr(win, "5.0"))
    return alloc_string("Windows 2000");
  return NULL;
}


x86 assembly (clang, -O0):
<get_real_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     115b <get_real_win+0x3b>
lea    0xeb8(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     118a <get_real_win+0x6a>
lea    0xe98(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     11b9 <get_real_win+0x99>
lea    0xe7e(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xe70(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     11e8 <get_real_win+0xc8>
lea    0xe4f(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1217 <get_real_win+0xf7>
lea    0xe38(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xe29(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1246 <get_real_win+0x126>
lea    0xe17(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xe08(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1275 <get_real_win+0x155>
lea    0xdf6(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xdeb(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     12a4 <get_real_win+0x184>
lea    0xdd9(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xdcf(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     12d3 <get_real_win+0x1b3>
lea    0xdbd(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
mov    -0x10(%rbp),%rdi
lea    0xdaf(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1302 <get_real_win+0x1e2>
lea    0xd9d(%rip),%rdi
call   1030 <alloc_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1337 <get_real_win+0x217>
jmp    1307 <get_real_win+0x1e7>
jmp    130c <get_real_win+0x1ec>
jmp    1311 <get_real_win+0x1f1>
jmp    1316 <get_real_win+0x1f6>
jmp    131b <get_real_win+0x1fb>
jmp    1320 <get_real_win+0x200>
jmp    1325 <get_real_win+0x205>
jmp    132a <get_real_win+0x20a>
jmp    132f <get_real_win+0x20f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_real_win>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1144 <get_real_win+0x24>
lea    0xec6(%rip),%rbx
jmp    124a <get_real_win+0x12a>
lea    0xec5(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     1164 <get_real_win+0x44>
lea    0xeb5(%rip),%rbx
jmp    124a <get_real_win+0x12a>
lea    0xeb5(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
lea    0xeaf(%rip),%rbx
test   %rax,%rax
jne    124a <get_real_win+0x12a>
lea    0xeaa(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
jne    124a <get_real_win+0x12a>
lea    0xe9b(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     11bb <get_real_win+0x9b>
lea    0xe8b(%rip),%rbx
jmp    124a <get_real_win+0x12a>
lea    0xe89(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     11d8 <get_real_win+0xb8>
lea    0xe79(%rip),%rbx
jmp    124a <get_real_win+0x12a>
lea    0xe7a(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     11f5 <get_real_win+0xd5>
lea    0xe6a(%rip),%rbx
jmp    124a <get_real_win+0x12a>
lea    0xe6f(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     1212 <get_real_win+0xf2>
lea    0xe5f(%rip),%rbx
jmp    124a <get_real_win+0x12a>
lea    0xe65(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     122f <get_real_win+0x10f>
lea    0xe55(%rip),%rbx
jmp    124a <get_real_win+0x12a>
lea    0xe57(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     1259 <get_real_win+0x139>
lea    0xe47(%rip),%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <alloc_string@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"10.0\00"
@.str.1 = [11 x i8] c"Windows 10\00"
@.str.2 = [4 x i8] c"6.3\00"
@.str.3 = [12 x i8] c"Windows 8.1\00"
@.str.4 = [9 x i8] c"6.3; ARM\00"
@.str.5 = [11 x i8] c"Windows RT\00"
@.str.6 = [9 x i8] c"6.2; ARM\00"
@.str.7 = [4 x i8] c"6.2\00"
@.str.8 = [10 x i8] c"Windows 8\00"
@.str.9 = [4 x i8] c"6.1\00"
@.str.10 = [10 x i8] c"Windows 7\00"
@.str.11 = [4 x i8] c"6.0\00"
@.str.12 = [14 x i8] c"Windows Vista\00"
@.str.13 = [4 x i8] c"5.2\00"
@.str.14 = [15 x i8] c"Windows XP x64\00"
@.str.15 = [4 x i8] c"5.1\00"
@.str.16 = [11 x i8] c"Windows XP\00"
@.str.17 = [4 x i8] c"5.0\00"
@.str.18 = [13 x i8] c"Windows 2000\00"
define i8* @get_real_win(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @alloc_string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i8* %8, i8** %2
br label %73
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strstr(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i8* @alloc_string(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
store i8* %14, i8** %2
br label %73
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i64 @strstr(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i8* @alloc_string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
store i8* %20, i8** %2
br label %73
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i64 @strstr(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i8* @alloc_string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
store i8* %26, i8** %2
br label %73
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = call i64 @strstr(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i8* @alloc_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
store i8* %32, i8** %2
br label %73
33: ; preds = %27
%34 = load i8*, i8** %3
%35 = call i64 @strstr(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i8* @alloc_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
store i8* %38, i8** %2
br label %73
39: ; preds = %33
%40 = load i8*, i8** %3
%41 = call i64 @strstr(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i8* @alloc_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
store i8* %44, i8** %2
br label %73
45: ; preds = %39
%46 = load i8*, i8** %3
%47 = call i64 @strstr(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i8* @alloc_string(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
store i8* %50, i8** %2
br label %73
51: ; preds = %45
%52 = load i8*, i8** %3
%53 = call i64 @strstr(i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i8* @alloc_string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
store i8* %56, i8** %2
br label %73
57: ; preds = %51
%58 = load i8*, i8** %3
%59 = call i64 @strstr(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = call i8* @alloc_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0))
store i8* %62, i8** %2
br label %73
63: ; preds = %57
br label %64
64: ; preds = %63
br label %65
65: ; preds = %64
br label %66
66: ; preds = %65
br label %67
67: ; preds = %66
br label %68
68: ; preds = %67
br label %69
69: ; preds = %68
br label %70
70: ; preds = %69
br label %71
71: ; preds = %70
br label %72
72: ; preds = %71
store i8* null, i8** %2
br label %73
73: ; preds = %72, %61, %55, %49, %43, %37, %31, %25, %19, %13, %7
%74 = load i8*, i8** %2
ret i8* %74
}

LLVM IR (-O2):
@.str = [5 x i8] c"10.0\00"
@.str.1 = [11 x i8] c"Windows 10\00"
@.str.2 = [4 x i8] c"6.3\00"
@.str.3 = [12 x i8] c"Windows 8.1\00"
@.str.4 = [9 x i8] c"6.3; ARM\00"
@.str.5 = [11 x i8] c"Windows RT\00"
@.str.6 = [9 x i8] c"6.2; ARM\00"
@.str.7 = [4 x i8] c"6.2\00"
@.str.8 = [10 x i8] c"Windows 8\00"
@.str.9 = [4 x i8] c"6.1\00"
@.str.10 = [10 x i8] c"Windows 7\00"
@.str.11 = [4 x i8] c"6.0\00"
@.str.12 = [14 x i8] c"Windows Vista\00"
@.str.13 = [4 x i8] c"5.2\00"
@.str.14 = [15 x i8] c"Windows XP x64\00"
@.str.15 = [4 x i8] c"5.1\00"
@.str.16 = [11 x i8] c"Windows XP\00"
@.str.17 = [4 x i8] c"5.0\00"
@.str.18 = [13 x i8] c"Windows 2000\00"
define i8* @get_real_win(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %31
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %31
7: ; preds = %4
%8 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %10
%14 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %31
19: ; preds = %16
%20 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %34, label %31
31: ; preds = %28, %25, %22, %19, %16, %13, %10, %7, %4, %1
%32 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %13 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), %16 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), %19 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), %22 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), %25 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), %28 ]
%33 = tail call i8* @alloc_string(i8* %32)
br label %34
34: ; preds = %31, %28
%35 = phi i8* [ null, %28 ], [ %33, %31 ]
ret i8* %35
}