void layoutSelect(int layoutOrder[]) {
  char userInput[64];
  char layoutSupport[4][8] = {"dvorak", "qwerty", "colemak", "workman"};
  int i, j;
  for (i = 0; i < 2;) {
    if (i == 1) {
      printf("What layout do you want the text translated to?\n$ ");
    } else {
      printf("Hello! What layout is your text in? Type \"help\" to learn "
             "more.\n$ ");
    }
    scanf("%s", userInput);
    if (strcmp(userInput, layoutSupport[0]) == 0) {
      layoutOrder[i] = 0;
      i++;
    } else if (strcmp(userInput, layoutSupport[1]) == 0) {
      layoutOrder[i] = 1;
      i++;
    } else if (strcmp(userInput, layoutSupport[2]) == 0) {
      layoutOrder[i] = 2;
      i++;
    } else if (strcmp(userInput, layoutSupport[3]) == 0) {
      layoutOrder[i] = 3;
      i++;
    } else if (strcmp(userInput, "help") == 0 ||
               strcmp(userInput, "HELP") == 0) {
      printf("HELP MENU\nList of commands:\n");
      printf("- \"help\": displays list of available commands\n");
      printf("- \"list\": lists supported layouts\n");
      printf("- \"quit\": exits program.\n$ ");
    } else if (strcmp(userInput, "list") == 0 || strcmp(userInput, "LIST")) {
      printf("List of supported layouts:\n");
      for (j = 0; j < 4; j++) {
        printf("%d: %s\n", j + 1, layoutSupport[j]);
      }
    } else if (strcmp(userInput, "quit") == 0 ||
               strcmp(userInput, "QUIT") == 0 || strcmp(userInput, "q") == 0) {
      exit(1);
    } else {
      printf("Unknown input \"%s\". Try again (type \"quit\" to leave).\n$ ",
             userInput);
    }
  }
}


x86 assembly (clang, -O0):
<layoutSelect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x2,-0x74(%rbp)
jge    1421 <layoutSelect+0x2e1>
cmpl   $0x1,-0x74(%rbp)
jne    11a9 <layoutSelect+0x69>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b7 <layoutSelect+0x77>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11fc <layoutSelect+0xbc>
mov    -0x8(%rbp),%rax
movslq -0x74(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    141c <layoutSelect+0x2dc>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
add    $0x8,%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1233 <layoutSelect+0xf3>
mov    -0x8(%rbp),%rax
movslq -0x74(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1417 <layoutSelect+0x2d7>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
add    $0x10,%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    126a <layoutSelect+0x12a>
mov    -0x8(%rbp),%rax
movslq -0x74(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1412 <layoutSelect+0x2d2>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
add    $0x18,%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12a1 <layoutSelect+0x161>
mov    -0x8(%rbp),%rax
movslq -0x74(%rbp),%rcx
movl   $0x3,(%rax,%rcx,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    140d <layoutSelect+0x2cd>
lea    -0x50(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     12d3 <layoutSelect+0x193>
lea    -0x50(%rbp),%rdi
lea    0xdd8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1310 <layoutSelect+0x1d0>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1408 <layoutSelect+0x2c8>
lea    -0x50(%rbp),%rdi
lea    0xe12(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     1342 <layoutSelect+0x202>
lea    -0x50(%rbp),%rdi
lea    0xdfe(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     1397 <layoutSelect+0x257>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x78(%rbp)
cmpl   $0x4,-0x78(%rbp)
jge    1392 <layoutSelect+0x252>
mov    -0x78(%rbp),%esi
add    $0x1,%esi
movslq -0x78(%rbp),%rax
lea    -0x70(%rbp),%rdx
shl    $0x3,%rax
add    %rax,%rdx
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1357 <layoutSelect+0x217>
jmp    1403 <layoutSelect+0x2c3>
lea    -0x50(%rbp),%rdi
lea    0xdb9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     13e2 <layoutSelect+0x2a2>
lea    -0x50(%rbp),%rdi
lea    0xda5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     13e2 <layoutSelect+0x2a2>
lea    -0x50(%rbp),%rdi
lea    0xd91(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13ec <layoutSelect+0x2ac>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    -0x50(%rbp),%rsi
lea    0xd70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1403 <layoutSelect+0x2c3>
jmp    1408 <layoutSelect+0x2c8>
jmp    140d <layoutSelect+0x2cd>
jmp    1412 <layoutSelect+0x2d2>
jmp    1417 <layoutSelect+0x2d7>
jmp    141c <layoutSelect+0x2dc>
jmp    1182 <layoutSelect+0x42>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<layoutSelect>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r13
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed4(%rip),%rbx
lea    0xf0f(%rip),%r15
lea    0x20(%rsp),%rbp
mov    %rsp,%r12
xor    %r14d,%r14d
jmp    11ba <layoutSelect+0x6a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %r14d,%rax
movl   $0x0,0x0(%r13,%rax,4)
add    $0x1,%r14d
cmp    $0x2,%r14d
jge    13b0 <layoutSelect+0x260>
cmp    $0x1,%r14d
mov    %rbx,%rdi
lea    0xe58(%rip),%rax
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11a0 <layoutSelect+0x50>
mov    %rbp,%rdi
lea    0x8(%rsp),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1300 <layoutSelect+0x1b0>
mov    %rbp,%rdi
lea    0x10(%rsp),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1311 <layoutSelect+0x1c1>
mov    %rbp,%rdi
lea    0x18(%rsp),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1359 <layoutSelect+0x209>
mov    0x20(%rsp),%eax
mov    $0x706c6568,%ecx
xor    %ecx,%eax
movzbl 0x24(%rsp),%ecx
or     %eax,%ecx
je     1322 <layoutSelect+0x1d2>
mov    0x20(%rsp),%eax
mov    $0x504c4548,%ecx
xor    %ecx,%eax
movzbl 0x24(%rsp),%ecx
or     %eax,%ecx
je     1322 <layoutSelect+0x1d2>
mov    0x20(%rsp),%eax
mov    $0x7473696c,%ecx
xor    %ecx,%eax
movzbl 0x24(%rsp),%ecx
or     %eax,%ecx
je     128a <layoutSelect+0x13a>
mov    0x20(%rsp),%eax
mov    $0x5453494c,%ecx
xor    %ecx,%eax
movzbl 0x24(%rsp),%ecx
or     %eax,%ecx
je     136a <layoutSelect+0x21a>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rbx
lea    0xe28(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x2,%esi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x3,%esi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%r15
lea    0xd6c(%rip),%rbx
mov    $0x4,%esi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b0 <layoutSelect+0x60>
nopl   (%rax)
movslq %r14d,%rax
movl   $0x1,0x0(%r13,%rax,4)
jmp    11ac <layoutSelect+0x5c>
movslq %r14d,%rax
movl   $0x2,0x0(%r13,%rax,4)
jmp    11ac <layoutSelect+0x5c>
lea    0xe05(%rip),%rdi
call   1030 <puts@plt>
lea    0xe15(%rip),%rdi
call   1030 <puts@plt>
lea    0xe37(%rip),%rdi
call   1030 <puts@plt>
lea    0xd55(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b0 <layoutSelect+0x60>
movslq %r14d,%rax
movl   $0x3,0x0(%r13,%rax,4)
jmp    11ac <layoutSelect+0x5c>
mov    0x20(%rsp),%eax
mov    $0x74697571,%ecx
xor    %ecx,%eax
movzbl 0x24(%rsp),%ecx
or     %eax,%ecx
je     13bf <layoutSelect+0x26f>
mov    0x20(%rsp),%eax
mov    $0x54495551,%ecx
xor    %ecx,%eax
movzbl 0x24(%rsp),%ecx
or     %eax,%ecx
je     13bf <layoutSelect+0x26f>
cmpw   $0x71,0x20(%rsp)
je     13bf <layoutSelect+0x26f>
lea    0xd39(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b0 <layoutSelect+0x60>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@__const.layoutSelect.layoutSupport = [4 x [8 x i8]] [[8 x i8] c"dvorak\00\00", [8 x i8] c"qwerty\00\00", [8 x i8] c"colemak\00", [8 x i8] c"workman\00"]
@.str = [51 x i8] c"What layout do you want the text translated to?\0A$ \00"
@.str.1 = [66 x i8] c"Hello! What layout is your text in? Type \22help\22 to learn more.\0A$ \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [5 x i8] c"HELP\00"
@.str.5 = [29 x i8] c"HELP MENU\0AList of commands:\0A\00"
@.str.6 = [47 x i8] c"- \22help\22: displays list of available commands\0A\00"
@.str.7 = [35 x i8] c"- \22list\22: lists supported layouts\0A\00"
@.str.8 = [28 x i8] c"- \22quit\22: exits program.\0A$ \00"
@.str.9 = [5 x i8] c"list\00"
@.str.10 = [5 x i8] c"LIST\00"
@.str.11 = [28 x i8] c"List of supported layouts:\0A\00"
@.str.12 = [8 x i8] c"%d: %s\0A\00"
@.str.13 = [5 x i8] c"quit\00"
@.str.14 = [5 x i8] c"QUIT\00"
@.str.15 = [2 x i8] c"q\00"
@.str.16 = [57 x i8] c"Unknown input \22%s\22. Try again (type \22quit\22 to leave).\0A$ \00"
define void @layoutSelect(i32* %0) {
%2 = alloca i32*
%3 = alloca [64 x i8]
%4 = alloca [4 x [8 x i8]]
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = bitcast [4 x [8 x i8]]* %4 to i8*
store i32 0, i32* %5
br label %8
8: ; preds = %132, %1
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %133
11: ; preds = %8
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
%19 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%22 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %4, i64 0, i64 0
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %22, i64 0, i64 0
%24 = call i32 @strcmp(i8* %21, i8* %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %18
%27 = load i32*, i32** %2
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 0, i32* %30
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %132
33: ; preds = %18
%34 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%35 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %4, i64 0, i64 1
%36 = getelementptr inbounds [8 x i8], [8 x i8]* %35, i64 0, i64 0
%37 = call i32 @strcmp(i8* %34, i8* %36)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %46
39: ; preds = %33
%40 = load i32*, i32** %2
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %40, i64 %42
store i32 1, i32* %43
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %131
46: ; preds = %33
%47 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%48 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %4, i64 0, i64 2
%49 = getelementptr inbounds [8 x i8], [8 x i8]* %48, i64 0, i64 0
%50 = call i32 @strcmp(i8* %47, i8* %49)
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %59
52: ; preds = %46
%53 = load i32*, i32** %2
%54 = load i32, i32* %5
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
store i32 2, i32* %56
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
br label %130
59: ; preds = %46
%60 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%61 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %4, i64 0, i64 3
%62 = getelementptr inbounds [8 x i8], [8 x i8]* %61, i64 0, i64 0
%63 = call i32 @strcmp(i8* %60, i8* %62)
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %72
65: ; preds = %59
%66 = load i32*, i32** %2
%67 = load i32, i32* %5
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %66, i64 %68
store i32 3, i32* %69
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
store i32 %71, i32* %5
br label %129
72: ; preds = %59
%73 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%74 = call i32 @strcmp(i8* %73, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%75 = icmp eq i32 %74, 0
br i1 %75, label %80, label %76
76: ; preds = %72
%77 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%78 = call i32 @strcmp(i8* %77, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %85
80: ; preds = %76, %72
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
br label %128
85: ; preds = %76
%86 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%87 = call i32 @strcmp(i8* %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%88 = icmp eq i32 %87, 0
br i1 %88, label %93, label %89
89: ; preds = %85
%90 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%91 = call i32 @strcmp(i8* %90, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %110
93: ; preds = %89, %85
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %6
br label %95
95: ; preds = %106, %93
%96 = load i32, i32* %6
%97 = icmp slt i32 %96, 4
br i1 %97, label %98, label %109
98: ; preds = %95
%99 = load i32, i32* %6
%100 = add nsw i32 %99, 1
%101 = load i32, i32* %6
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %4, i64 0, i64 %102
%104 = getelementptr inbounds [8 x i8], [8 x i8]* %103, i64 0, i64 0
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 %100, i8* %104)
br label %106
106: ; preds = %98
%107 = load i32, i32* %6
%108 = add nsw i32 %107, 1
store i32 %108, i32* %6
br label %95
109: ; preds = %95
br label %127
110: ; preds = %89
%111 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%112 = call i32 @strcmp(i8* %111, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%113 = icmp eq i32 %112, 0
br i1 %113, label %122, label %114
114: ; preds = %110
%115 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%116 = call i32 @strcmp(i8* %115, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%117 = icmp eq i32 %116, 0
br i1 %117, label %122, label %118
118: ; preds = %114
%119 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%120 = call i32 @strcmp(i8* %119, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %123
122: ; preds = %118, %114, %110
unreachable
123: ; preds = %118
%124 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.16, i64 0, i64 0), i8* %124)
br label %126
126: ; preds = %123
br label %127
127: ; preds = %126, %109
br label %128
128: ; preds = %127, %80
br label %129
129: ; preds = %128, %65
br label %130
130: ; preds = %129, %52
br label %131
131: ; preds = %130, %39
br label %132
132: ; preds = %131, %26
br label %8
133: ; preds = %8
ret void
}

LLVM IR (-O2):
@__const.layoutSelect.layoutSupport = [4 x [8 x i8]] [[8 x i8] c"dvorak\00\00", [8 x i8] c"qwerty\00\00", [8 x i8] c"colemak\00", [8 x i8] c"workman\00"]
@.str = [51 x i8] c"What layout do you want the text translated to?\0A$ \00"
@.str.1 = [66 x i8] c"Hello! What layout is your text in? Type \22help\22 to learn more.\0A$ \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [5 x i8] c"HELP\00"
@.str.8 = [28 x i8] c"- \22quit\22: exits program.\0A$ \00"
@.str.9 = [5 x i8] c"list\00"
@.str.10 = [5 x i8] c"LIST\00"
@.str.12 = [8 x i8] c"%d: %s\0A\00"
@.str.13 = [5 x i8] c"quit\00"
@.str.14 = [5 x i8] c"QUIT\00"
@.str.16 = [57 x i8] c"Unknown input \22%s\22. Try again (type \22quit\22 to leave).\0A$ \00"
@str = [27 x i8] c"List of supported layouts:\00"
@str.17 = [28 x i8] c"HELP MENU\0AList of commands:\00"
@str.18 = [46 x i8] c"- \22help\22: displays list of available commands\00"
@str.19 = [34 x i8] c"- \22list\22: lists supported layouts\00"
define void @layoutSelect(i32* nocapture writeonly %0) {
%2 = alloca [64 x i8]
%3 = alloca [4 x [8 x i8]]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %3, i64 0, i64 0, i64 0
%6 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %3, i64 0, i64 1, i64 0
%7 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %3, i64 0, i64 2, i64 0
%8 = getelementptr inbounds [4 x [8 x i8]], [4 x [8 x i8]]* %3, i64 0, i64 3, i64 0
%9 = bitcast [64 x i8]* %2 to i16*
br label %10
10: ; preds = %1, %78
%11 = phi i32 [ 0, %1 ], [ %79, %78 ]
%12 = icmp eq i32 %11, 1
%13 = select i1 %12, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %13)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%16 = call i32 @strcmp(i8* %4, i8* %5)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %10
%19 = sext i32 %11 to i64
%20 = getelementptr inbounds i32, i32* %0, i64 %19
store i32 0, i32* %20
%21 = add nsw i32 %11, 1
br label %78
22: ; preds = %10
%23 = call i32 @strcmp(i8* %4, i8* %6)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = sext i32 %11 to i64
%27 = getelementptr inbounds i32, i32* %0, i64 %26
store i32 1, i32* %27
%28 = add nsw i32 %11, 1
br label %78
29: ; preds = %22
%30 = call i32 @strcmp(i8* %4, i8* %7)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = sext i32 %11 to i64
%34 = getelementptr inbounds i32, i32* %0, i64 %33
store i32 2, i32* %34
%35 = add nsw i32 %11, 1
br label %78
36: ; preds = %29
%37 = call i32 @strcmp(i8* %4, i8* %8)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = sext i32 %11 to i64
%41 = getelementptr inbounds i32, i32* %0, i64 %40
store i32 3, i32* %41
%42 = add nsw i32 %11, 1
br label %78
43: ; preds = %36
%44 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 5)
%45 = icmp eq i32 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5)
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %54
49: ; preds = %46, %43
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.17, i64 0, i64 0))
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.18, i64 0, i64 0))
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.19, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
br label %78
54: ; preds = %46
%55 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i64 5)
%56 = icmp eq i32 %55, 0
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 5)
%59 = icmp eq i32 %58, 0
br i1 %59, label %66, label %60
60: ; preds = %57, %54
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 1, i8* %5)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 2, i8* %6)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 3, i8* %7)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 4, i8* %8)
br label %78
66: ; preds = %57
%67 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i64 5)
%68 = icmp eq i32 %67, 0
br i1 %68, label %75, label %69
69: ; preds = %66
%70 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 5)
%71 = icmp eq i32 %70, 0
%72 = load i16, i16* %9
%73 = icmp eq i16 %72, 113
%74 = select i1 %71, i1 true, i1 %73
br i1 %74, label %75, label %76
75: ; preds = %69, %66
unreachable
76: ; preds = %69
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.16, i64 0, i64 0), i8* %4)
br label %78
78: ; preds = %60, %25, %39, %76, %49, %32, %18
%79 = phi i32 [ %21, %18 ], [ %28, %25 ], [ %35, %32 ], [ %42, %39 ], [ %11, %49 ], [ %11, %76 ], [ %11, %60 ]
%80 = icmp slt i32 %79, 2
br i1 %80, label %10, label %81
81: ; preds = %78
ret void
}