void inputsetup_menu(int pl, int x, int y) {
  const char *menu[11] = {" Up",     "Dwn",      "Lft",      "Rgt",
                          "  A",     "  B",      " Rotate ", " Rot cw ",
                          (void *)0, "Harddrop", "Softdrop"};
  char rot_acw[9] = " Rot acw";
  int dev = 0;
  int i = 0;
  int xx, k;
  spellword(rot_acw + 5);
  menu[8] = rot_acw;
  drawmenu(menu, 6, i, x, y, (void *)0);
  drawmenu(menu + 6, 5, -1, x + 12, y, (void *)0);
  while (1) {
    inp_printkeys(dev, x, y);
    xx = inp_setcurs(x, y, i);
    refreshwin(-1);
    k = setkeymapping(dev, inp_keypr(i));
    if (k == 3 && !i)
      k = 4;
    else if (k == 4 && i == 10) {
      printmenuitem(menu[10], 0);
      inp_setcurs(x, y, i = 0);
      printmenuitem(menu[0], 1);
      continue;
    }
    switch (
        handle_menuitem_2cols(menu, 11, &i, 6, xx, y + i % 6, (void *)0, k)) {
    case 0:
    case 2:
      return;
    case 3:
      inp_setcurs(x, y, i);
      printmenuitem(menu[i], 1);
    }
  }
}


x86 assembly (clang, -O0):
<inputsetup_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
lea    0x2c01(%rip),%rsi
mov    $0x58,%edx
call   1060 <memcpy@plt>
mov    0xe6c(%rip),%rax
mov    %rax,-0x79(%rbp)
mov    0xe6a(%rip),%al
mov    %al,-0x71(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
lea    -0x79(%rbp),%rdi
add    $0x5,%rdi
mov    $0x0,%al
call   10b0 <spellword@plt>
lea    -0x79(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x84(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    $0x6,%esi
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1080 <drawmenu@plt>
lea    -0x70(%rbp),%rdi
add    $0x30,%rdi
mov    -0x8(%rbp),%ecx
add    $0xc,%ecx
mov    -0xc(%rbp),%r8d
mov    $0x5,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1080 <drawmenu@plt>
mov    -0x80(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1050 <inp_printkeys@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x84(%rbp),%edx
mov    $0x0,%al
call   1030 <inp_setcurs@plt>
mov    %eax,-0x88(%rbp)
mov    $0xffffffff,%edi
mov    $0x0,%al
call   1090 <refreshwin@plt>
mov    -0x80(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x84(%rbp),%edi
mov    $0x0,%al
call   1040 <inp_keypr@plt>
mov    -0x90(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   10c0 <setkeymapping@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0x3,-0x8c(%rbp)
jne    12d8 <inputsetup_menu+0x138>
cmpl   $0x0,-0x84(%rbp)
jne    12d8 <inputsetup_menu+0x138>
movl   $0x4,-0x8c(%rbp)
jmp    1332 <inputsetup_menu+0x192>
cmpl   $0x4,-0x8c(%rbp)
jne    132d <inputsetup_menu+0x18d>
cmpl   $0xa,-0x84(%rbp)
jne    132d <inputsetup_menu+0x18d>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   10a0 <printmenuitem@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
movl   $0x0,-0x84(%rbp)
xor    %edx,%edx
mov    $0x0,%al
call   1030 <inp_setcurs@plt>
mov    -0x70(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   10a0 <printmenuitem@plt>
jmp    124f <inputsetup_menu+0xaf>
jmp    1332 <inputsetup_menu+0x192>
mov    -0x88(%rbp),%r8d
mov    -0xc(%rbp),%r9d
movslq -0x84(%rbp),%rcx
mov    %ecx,%eax
imul   $0x2aaaaaab,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
add    %ecx,%edx
add    %edx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
add    %eax,%r9d
mov    -0x8c(%rbp),%ecx
mov    %rsp,%rax
mov    %ecx,0x8(%rax)
movq   $0x0,(%rax)
xor    %eax,%eax
lea    -0x70(%rbp),%rdi
mov    $0xb,%esi
lea    -0x84(%rbp),%rdx
mov    $0x6,%ecx
call   1070 <handle_menuitem_2cols@plt>
mov    %eax,%ecx
mov    %ecx,-0x94(%rbp)
test   %eax,%eax
je     13d2 <inputsetup_menu+0x232>
jmp    13aa <inputsetup_menu+0x20a>
mov    -0x94(%rbp),%eax
sub    $0x2,%eax
je     13d2 <inputsetup_menu+0x232>
jmp    13be <inputsetup_menu+0x21e>
mov    -0x94(%rbp),%eax
sub    $0x3,%eax
je     13db <inputsetup_menu+0x23b>
jmp    1406 <inputsetup_menu+0x266>
add    $0xb0,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x84(%rbp),%edx
mov    $0x0,%al
call   1030 <inp_setcurs@plt>
movslq -0x84(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   10a0 <printmenuitem@plt>
jmp    124f <inputsetup_menu+0xaf>

x86 assembly (clang, -O2):
<inputsetup_menu>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %edx,%r13d
mov    %esi,%r14d
mov    0x2c65(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0x2c49(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2c2d(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2c11(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2bf5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2bd9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x50(%rsp),%rbp
movabs $0x77636120746f5220,%rax
61 63 77
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x15(%rsp),%rdi
xor    %eax,%eax
call   10a0 <spellword@plt>
lea    0x10(%rsp),%rax
mov    %rax,0x60(%rsp)
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    $0x6,%esi
xor    %edx,%edx
mov    %r14d,%ecx
mov    %r13d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1070 <drawmenu@plt>
lea    0xc(%r14),%ecx
mov    %rbp,%rdi
mov    $0x5,%esi
mov    $0xffffffff,%edx
mov    %r13d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1070 <drawmenu@plt>
lea    0xc(%rsp),%r12
jmp    1297 <inputsetup_menu+0x107>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%edx
mov    %r14d,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <inp_setcurs@plt>
movslq 0xc(%rsp),%rax
mov    0x20(%rsp,%rax,8),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1090 <printmenuitem@plt>
xor    %edi,%edi
mov    %r14d,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <inp_printkeys@plt>
mov    0xc(%rsp),%edx
mov    %r14d,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <inp_setcurs@plt>
mov    %eax,%ebp
mov    $0xffffffff,%edi
xor    %eax,%eax
call   1080 <refreshwin@plt>
mov    0xc(%rsp),%edi
xor    %eax,%eax
call   1040 <inp_keypr@plt>
xor    %edi,%edi
mov    %eax,%esi
xor    %eax,%eax
call   10b0 <setkeymapping@plt>
mov    0xc(%rsp),%r9d
cmp    $0x3,%eax
jne    1350 <inputsetup_menu+0x1c0>
mov    $0x4,%ebx
test   %r9d,%r9d
jne    1350 <inputsetup_menu+0x1c0>
movslq %r9d,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%r9d
add    %r13d,%r9d
mov    %r15,%rdi
mov    $0xb,%esi
mov    %r12,%rdx
mov    $0x6,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
push   %rbx
push   $0x0
call   1060 <handle_menuitem_2cols@plt>
add    $0x10,%rsp
cmp    $0x3,%eax
je     1270 <inputsetup_menu+0xe0>
cmp    $0x2,%eax
je     138c <inputsetup_menu+0x1fc>
test   %eax,%eax
jne    1297 <inputsetup_menu+0x107>
jmp    138c <inputsetup_menu+0x1fc>
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebx
cmp    $0x4,%eax
jne    12ef <inputsetup_menu+0x15f>
cmp    $0xa,%r9d
jne    12ef <inputsetup_menu+0x15f>
mov    0x70(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1090 <printmenuitem@plt>
movl   $0x0,0xc(%rsp)
mov    %r14d,%edi
mov    %r13d,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <inp_setcurs@plt>
mov    0x20(%rsp),%rdi
jmp    128b <inputsetup_menu+0xfb>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c" Up\00"
@.str.1 = [4 x i8] c"Dwn\00"
@.str.2 = [4 x i8] c"Lft\00"
@.str.3 = [4 x i8] c"Rgt\00"
@.str.4 = [4 x i8] c" A\00"
@.str.5 = [4 x i8] c" B\00"
@.str.6 = [9 x i8] c" Rotate \00"
@.str.7 = [9 x i8] c" Rot cw \00"
@.str.8 = [9 x i8] c"Harddrop\00"
@.str.9 = [9 x i8] c"Softdrop\00"
@__const.inputsetup_menu.menu = [11 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0), i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i32 0, i32 0)]
@__const.inputsetup_menu.rot_acw = [9 x i8] c" Rot acw\00"
define void @inputsetup_menu(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [11 x i8*]
%8 = alloca [9 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%13 = bitcast [11 x i8*]* %7 to i8*
%14 = bitcast [9 x i8]* %8 to i8*
store i32 0, i32* %9
store i32 0, i32* %10
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%16 = getelementptr inbounds i8, i8* %15, i64 5
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @spellword to i32 (i8*, ...)*)(i8* %16)
%18 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%19 = getelementptr inbounds [11 x i8*], [11 x i8*]* %7, i64 0, i64 8
store i8* %18, i8** %19
%20 = getelementptr inbounds [11 x i8*], [11 x i8*]* %7, i64 0, i64 0
%21 = load i32, i32* %10
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = call i32 (i8**, i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @drawmenu to i32 (i8**, i32, i32, i32, i32, i8*, ...)*)(i8** %20, i32 6, i32 %21, i32 %22, i32 %23, i8* null)
%25 = getelementptr inbounds [11 x i8*], [11 x i8*]* %7, i64 0, i64 0
%26 = getelementptr inbounds i8*, i8** %25, i64 6
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 12
%29 = load i32, i32* %6
%30 = call i32 (i8**, i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @drawmenu to i32 (i8**, i32, i32, i32, i32, i8*, ...)*)(i8** %26, i32 5, i32 -1, i32 %28, i32 %29, i8* null)
br label %31
31: ; preds = %3, %57, %88
%32 = load i32, i32* %9
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_printkeys to i32 (i32, i32, i32, ...)*)(i32 %32, i32 %33, i32 %34)
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = load i32, i32* %10
%39 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_setcurs to i32 (i32, i32, i32, ...)*)(i32 %36, i32 %37, i32 %38)
store i32 %39, i32* %11
%40 = call i32 (i32, ...) bitcast (i32 (...)* @refreshwin to i32 (i32, ...)*)(i32 -1)
%41 = load i32, i32* %9
%42 = load i32, i32* %10
%43 = call i32 (i32, ...) bitcast (i32 (...)* @inp_keypr to i32 (i32, ...)*)(i32 %42)
%44 = call i32 (i32, i32, ...) bitcast (i32 (...)* @setkeymapping to i32 (i32, i32, ...)*)(i32 %41, i32 %43)
store i32 %44, i32* %12
%45 = load i32, i32* %12
%46 = icmp eq i32 %45, 3
br i1 %46, label %47, label %51
47: ; preds = %31
%48 = load i32, i32* %10
%49 = icmp ne i32 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %47
store i32 4, i32* %12
br label %68
51: ; preds = %47, %31
%52 = load i32, i32* %12
%53 = icmp eq i32 %52, 4
br i1 %53, label %54, label %67
54: ; preds = %51
%55 = load i32, i32* %10
%56 = icmp eq i32 %55, 10
br i1 %56, label %57, label %67
57: ; preds = %54
%58 = getelementptr inbounds [11 x i8*], [11 x i8*]* %7, i64 0, i64 10
%59 = load i8*, i8** %58
%60 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @printmenuitem to i32 (i8*, i32, ...)*)(i8* %59, i32 0)
%61 = load i32, i32* %5
%62 = load i32, i32* %6
store i32 0, i32* %10
%63 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_setcurs to i32 (i32, i32, i32, ...)*)(i32 %61, i32 %62, i32 0)
%64 = getelementptr inbounds [11 x i8*], [11 x i8*]* %7, i64 0, i64 0
%65 = load i8*, i8** %64
%66 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @printmenuitem to i32 (i8*, i32, ...)*)(i8* %65, i32 1)
br label %31
67: ; preds = %54, %51
br label %68
68: ; preds = %67, %50
%69 = getelementptr inbounds [11 x i8*], [11 x i8*]* %7, i64 0, i64 0
%70 = load i32, i32* %11
%71 = load i32, i32* %6
%72 = load i32, i32* %10
%73 = srem i32 %72, 6
%74 = add nsw i32 %71, %73
%75 = load i32, i32* %12
%76 = call i32 (i8**, i32, i32*, i32, i32, i32, i8*, i32, ...) bitcast (i32 (...)* @handle_menuitem_2cols to i32 (i8**, i32, i32*, i32, i32, i32, i8*, i32, ...)*)(i8** %69, i32 11, i32* %10, i32 6, i32 %70, i32 %74, i8* null, i32 %75)
switch i32 %76, label %88 [
i32 0, label %77
i32 2, label %77
i32 3, label %78
]
77: ; preds = %68, %68
ret void
78: ; preds = %68
%79 = load i32, i32* %5
%80 = load i32, i32* %6
%81 = load i32, i32* %10
%82 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_setcurs to i32 (i32, i32, i32, ...)*)(i32 %79, i32 %80, i32 %81)
%83 = load i32, i32* %10
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [11 x i8*], [11 x i8*]* %7, i64 0, i64 %84
%86 = load i8*, i8** %85
%87 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @printmenuitem to i32 (i8*, i32, ...)*)(i8* %86, i32 1)
br label %88
88: ; preds = %78, %68
br label %31
}

LLVM IR (-O2):
@.str = [4 x i8] c" Up\00"
@.str.1 = [4 x i8] c"Dwn\00"
@.str.2 = [4 x i8] c"Lft\00"
@.str.3 = [4 x i8] c"Rgt\00"
@.str.4 = [4 x i8] c" A\00"
@.str.5 = [4 x i8] c" B\00"
@.str.6 = [9 x i8] c" Rotate \00"
@.str.7 = [9 x i8] c" Rot cw \00"
@.str.8 = [9 x i8] c"Harddrop\00"
@.str.9 = [9 x i8] c"Softdrop\00"
@__const.inputsetup_menu.menu = [11 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0), i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i32 0, i32 0)]
@__const.inputsetup_menu.rot_acw = [9 x i8] c" Rot acw\00"
define void @inputsetup_menu(i32 %0, i32 %1, i32 %2) {
%4 = alloca [11 x i8*]
%5 = alloca [9 x i8]
%6 = alloca i32
%7 = bitcast [11 x i8*]* %4 to i8*
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%9 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 5
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @spellword to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds [11 x i8*], [11 x i8*]* %4, i64 0, i64 8
store i8* %8, i8** %12
%13 = getelementptr inbounds [11 x i8*], [11 x i8*]* %4, i64 0, i64 0
%14 = call i32 (i8**, i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @drawmenu to i32 (i8**, i32, i32, i32, i32, i8*, ...)*)(i8** %13, i32 6, i32 0, i32 %1, i32 %2, i8* null)
%15 = getelementptr inbounds [11 x i8*], [11 x i8*]* %4, i64 0, i64 6
%16 = add nsw i32 %1, 12
%17 = call i32 (i8**, i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @drawmenu to i32 (i8**, i32, i32, i32, i32, i8*, ...)*)(i8** %15, i32 5, i32 -1, i32 %16, i32 %2, i8* null)
%18 = getelementptr inbounds [11 x i8*], [11 x i8*]* %4, i64 0, i64 10
br label %19
19: ; preds = %43, %3
%20 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_printkeys to i32 (i32, i32, i32, ...)*)(i32 0, i32 %1, i32 %2)
%21 = load i32, i32* %6
%22 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_setcurs to i32 (i32, i32, i32, ...)*)(i32 %1, i32 %2, i32 %21)
%23 = call i32 (i32, ...) bitcast (i32 (...)* @refreshwin to i32 (i32, ...)*)(i32 -1)
%24 = load i32, i32* %6
%25 = call i32 (i32, ...) bitcast (i32 (...)* @inp_keypr to i32 (i32, ...)*)(i32 %24)
%26 = call i32 (i32, i32, ...) bitcast (i32 (...)* @setkeymapping to i32 (i32, i32, ...)*)(i32 0, i32 %25)
%27 = icmp ne i32 %26, 3
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
%30 = select i1 %27, i1 true, i1 %29
br i1 %30, label %31, label %44
31: ; preds = %19
%32 = icmp eq i32 %26, 4
%33 = icmp eq i32 %28, 10
%34 = select i1 %32, i1 %33, i1 false
br i1 %34, label %35, label %44
35: ; preds = %31
%36 = load i8*, i8** %18
%37 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @printmenuitem to i32 (i8*, i32, ...)*)(i8* %36, i32 0)
store i32 0, i32* %6
%38 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_setcurs to i32 (i32, i32, i32, ...)*)(i32 %1, i32 %2, i32 0)
%39 = load i8*, i8** %13
br label %40
40: ; preds = %35, %50
%41 = phi i8* [ %56, %50 ], [ %39, %35 ]
%42 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @printmenuitem to i32 (i8*, i32, ...)*)(i8* %41, i32 1)
br label %43
43: ; preds = %40, %44
br label %19
44: ; preds = %19, %31
%45 = phi i32 [ %26, %31 ], [ 4, %19 ]
%46 = srem i32 %28, 6
%47 = add nsw i32 %46, %2
%48 = call i32 (i8**, i32, i32*, i32, i32, i32, i8*, i32, ...) bitcast (i32 (...)* @handle_menuitem_2cols to i32 (i8**, i32, i32*, i32, i32, i32, i8*, i32, ...)*)(i8** %13, i32 11, i32* %6, i32 6, i32 %22, i32 %47, i8* null, i32 %45)
switch i32 %48, label %43 [
i32 0, label %49
i32 2, label %49
i32 3, label %50
]
49: ; preds = %44, %44
ret void
50: ; preds = %44
%51 = load i32, i32* %6
%52 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @inp_setcurs to i32 (i32, i32, i32, ...)*)(i32 %1, i32 %2, i32 %51)
%53 = load i32, i32* %6
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [11 x i8*], [11 x i8*]* %4, i64 0, i64 %54
%56 = load i8*, i8** %55
br label %40
}