char *return_ctx_var(char *name) {
  int yo;
  static char thevar[20];
  for (yo = 0; yo < 18; yo++) {
    if (name[yo] == '.' || name[yo] == '\0') {
      thevar[yo] = '\0';
      return thevar;
    }
    thevar[yo] = name[yo];
  }
  return thevar;
}


x86 assembly (clang, -O0):
<return_ctx_var>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x12,-0x14(%rbp)
jge    1189 <return_ctx_var+0x89>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
je     1143 <return_ctx_var+0x43>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1162 <return_ctx_var+0x62>
movslq -0x14(%rbp),%rcx
lea    0x2ee2(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ed7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1194 <return_ctx_var+0x94>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
movslq -0x14(%rbp),%rcx
lea    0x2eb8(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <return_ctx_var+0xf>
lea    0x2ea0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_ctx_var>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2f15(%rip)
mov    0x1(%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2ef7(%rip)
mov    0x2(%rdi),%cl
mov    $0x2,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2ed9(%rip)
mov    0x3(%rdi),%cl
mov    $0x3,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2ebb(%rip)
mov    0x4(%rdi),%cl
mov    $0x4,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2e9d(%rip)
mov    0x5(%rdi),%cl
mov    $0x5,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2e7f(%rip)
mov    0x6(%rdi),%cl
mov    $0x6,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2e61(%rip)
mov    0x7(%rdi),%cl
mov    $0x7,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2e43(%rip)
mov    0x8(%rdi),%cl
mov    $0x8,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2e25(%rip)
mov    0x9(%rdi),%cl
mov    $0x9,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2e07(%rip)
mov    0xa(%rdi),%cl
mov    $0xa,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2de9(%rip)
mov    0xb(%rdi),%cl
mov    $0xb,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2dcb(%rip)
mov    0xc(%rdi),%cl
mov    $0xc,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2db5(%rip)
mov    0xd(%rdi),%cl
mov    $0xd,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2d9f(%rip)
mov    0xe(%rdi),%cl
mov    $0xe,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2d89(%rip)
mov    0xf(%rdi),%cl
mov    $0xf,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2d73(%rip)
mov    0x10(%rdi),%cl
mov    $0x10,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
je     12f4 <return_ctx_var+0x1f4>
mov    %cl,0x2d5d(%rip)
mov    0x11(%rdi),%cl
mov    $0x11,%eax
test   %cl,%cl
je     12f4 <return_ctx_var+0x1f4>
cmp    $0x2e,%cl
jne    1307 <return_ctx_var+0x207>
lea    0x2d35(%rip),%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0x2d2a(%rip),%rax
ret
mov    %cl,0x2d34(%rip)
lea    0x2d1c(%rip),%rax
ret

LLVM IR (-O0):
@return_ctx_var.thevar = internal global [20 x i8] zeroinitializer
define i8* @return_ctx_var(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %37, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 18
br i1 %7, label %8, label %40
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 46
br i1 %15, label %24, label %16
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %16, %8
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 %26
store i8 0, i8* %27
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 0), i8** %2
br label %41
28: ; preds = %16
%29 = load i8*, i8** %3
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 %35
store i8 %33, i8* %36
br label %37
37: ; preds = %28
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %5
40: ; preds = %5
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 0), i8** %2
br label %41
41: ; preds = %40, %24
%42 = load i8*, i8** %2
ret i8* %42
}

LLVM IR (-O2):
@return_ctx_var.thevar = internal global [20 x i8] zeroinitializer
define i8* @return_ctx_var(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %6 [
i8 46, label %3
i8 0, label %3
]
3: ; preds = %54, %54, %51, %51, %48, %48, %45, %45, %42, %42, %39, %39, %36, %36, %33, %33, %30, %30, %27, %27, %24, %24, %21, %21, %18, %18, %15, %15, %12, %12, %9, %9, %6, %6, %1, %1
%4 = phi i64 [ 0, %1 ], [ 0, %1 ], [ 1, %6 ], [ 1, %6 ], [ 2, %9 ], [ 2, %9 ], [ 3, %12 ], [ 3, %12 ], [ 4, %15 ], [ 4, %15 ], [ 5, %18 ], [ 5, %18 ], [ 6, %21 ], [ 6, %21 ], [ 7, %24 ], [ 7, %24 ], [ 8, %27 ], [ 8, %27 ], [ 9, %30 ], [ 9, %30 ], [ 10, %33 ], [ 10, %33 ], [ 11, %36 ], [ 11, %36 ], [ 12, %39 ], [ 12, %39 ], [ 13, %42 ], [ 13, %42 ], [ 14, %45 ], [ 14, %45 ], [ 15, %48 ], [ 15, %48 ], [ 16, %51 ], [ 16, %51 ], [ 17, %54 ], [ 17, %54 ]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 %4
store i8 0, i8* %5
br label %58
6: ; preds = %1
store i8 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 0)
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 46, label %3
i8 0, label %3
]
9: ; preds = %6
store i8 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 1)
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
switch i8 %11, label %12 [
i8 46, label %3
i8 0, label %3
]
12: ; preds = %9
store i8 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 2)
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
switch i8 %14, label %15 [
i8 46, label %3
i8 0, label %3
]
15: ; preds = %12
store i8 %14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 3)
%16 = getelementptr inbounds i8, i8* %0, i64 4
%17 = load i8, i8* %16
switch i8 %17, label %18 [
i8 46, label %3
i8 0, label %3
]
18: ; preds = %15
store i8 %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 4)
%19 = getelementptr inbounds i8, i8* %0, i64 5
%20 = load i8, i8* %19
switch i8 %20, label %21 [
i8 46, label %3
i8 0, label %3
]
21: ; preds = %18
store i8 %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 5)
%22 = getelementptr inbounds i8, i8* %0, i64 6
%23 = load i8, i8* %22
switch i8 %23, label %24 [
i8 46, label %3
i8 0, label %3
]
24: ; preds = %21
store i8 %23, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 6)
%25 = getelementptr inbounds i8, i8* %0, i64 7
%26 = load i8, i8* %25
switch i8 %26, label %27 [
i8 46, label %3
i8 0, label %3
]
27: ; preds = %24
store i8 %26, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 7)
%28 = getelementptr inbounds i8, i8* %0, i64 8
%29 = load i8, i8* %28
switch i8 %29, label %30 [
i8 46, label %3
i8 0, label %3
]
30: ; preds = %27
store i8 %29, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 8)
%31 = getelementptr inbounds i8, i8* %0, i64 9
%32 = load i8, i8* %31
switch i8 %32, label %33 [
i8 46, label %3
i8 0, label %3
]
33: ; preds = %30
store i8 %32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 9)
%34 = getelementptr inbounds i8, i8* %0, i64 10
%35 = load i8, i8* %34
switch i8 %35, label %36 [
i8 46, label %3
i8 0, label %3
]
36: ; preds = %33
store i8 %35, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 10)
%37 = getelementptr inbounds i8, i8* %0, i64 11
%38 = load i8, i8* %37
switch i8 %38, label %39 [
i8 46, label %3
i8 0, label %3
]
39: ; preds = %36
store i8 %38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 11)
%40 = getelementptr inbounds i8, i8* %0, i64 12
%41 = load i8, i8* %40
switch i8 %41, label %42 [
i8 46, label %3
i8 0, label %3
]
42: ; preds = %39
store i8 %41, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 12)
%43 = getelementptr inbounds i8, i8* %0, i64 13
%44 = load i8, i8* %43
switch i8 %44, label %45 [
i8 46, label %3
i8 0, label %3
]
45: ; preds = %42
store i8 %44, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 13)
%46 = getelementptr inbounds i8, i8* %0, i64 14
%47 = load i8, i8* %46
switch i8 %47, label %48 [
i8 46, label %3
i8 0, label %3
]
48: ; preds = %45
store i8 %47, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 14)
%49 = getelementptr inbounds i8, i8* %0, i64 15
%50 = load i8, i8* %49
switch i8 %50, label %51 [
i8 46, label %3
i8 0, label %3
]
51: ; preds = %48
store i8 %50, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 15)
%52 = getelementptr inbounds i8, i8* %0, i64 16
%53 = load i8, i8* %52
switch i8 %53, label %54 [
i8 46, label %3
i8 0, label %3
]
54: ; preds = %51
store i8 %53, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 16)
%55 = getelementptr inbounds i8, i8* %0, i64 17
%56 = load i8, i8* %55
switch i8 %56, label %57 [
i8 46, label %3
i8 0, label %3
]
57: ; preds = %54
store i8 %56, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 17)
br label %58
58: ; preds = %57, %3
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @return_ctx_var.thevar, i64 0, i64 0)
}