#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 */
int check(int, char const **, char *, char *);
int mgh_umck(const char **str, int n, int prob) {
  int status = (0);
  switch (prob) {
  case 1:
    status = check(n == 3, str, "Helical valley function.",
                   "N must be 3 for problem #1");
    break;
  case 2:
    status = check(n == 6, str, "Biggs exp6 function.",
                   "N must be 6 for problem #2");
    break;
  case 3:
    status =
        check(n == 3, str, "Gaussian function.", "N must be 3 for problem #3");
    break;
  case 4:
    status = check(n == 2, str, "Powell badly scaled function.",
                   "N must be 2 for problem #4");
    break;
  case 5:
    status = check(n == 3, str, "Box 3-dimensional function.",
                   "N must be 3 for problem #5");
    break;
  case 6:
    status = check(n >= 1, str, "Variably dimensioned function.",
                   "N must be >= 1 in problem #6");
    break;
  case 7:
    status =
        check(n >= 2, str, "Watson function.",
              "N may be 2 or greater but is usually 6 or 9 for problem #7");
    break;
  case 8:
    status = check(n >= 1, str, "Penalty function I.",
                   "N must be >= 1 in problem #8");
    break;
  case 9:
    status = check(n >= 1, str, "Penalty function II.",
                   "N must be >= 1 in problem #9");
    break;
  case 10:
    status = check(n == 2, str, "Brown badly scaled function.",
                   "N must be 2 for problem #10");
    break;
  case 11:
    status = check(n == 4, str, "Brown and Dennis function.",
                   "N must be 4 for problem #11");
    break;
  case 12:
    status = check(n == 3, str, "Gulf research and development function.",
                   "N must be 3 for problem #12");
    break;
  case 13:
    status = check(n >= 1, str, "Trigonometric function.",
                   "N must be >= 1 in problem #13");
    break;
  case 14:
    status = check(n >= 1 && n % 2 == 0, str, "Extended Rosenbrock function.",
                   "N must be a multiple of 2 in problem #14");
    break;
  case 15:
    status = check(n >= 1 && n % 4 == 0, str, "Extended Powell function.",
                   "N must be a multiple of 4 in problem #15");
    break;
  case 16:
    status =
        check(n == 2, str, "Beale function.", "N must be 2 for problem #16");
    break;
  case 17:
    status =
        check(n == 4, str, "Wood function.", "N must be 4 for problem #17");
    break;
  case 18:
    status = check(n >= 1 && n <= 50, str, "Chebyquad function.",
                   "N must be <= "
                   "50"
                   " for problem #18");
    break;
  default:
    status = (-1);
    if (str != NULL) {
      *str = "PROB must be an integer between 1 and 18";
    }
  }
  return status;
}


x86 assembly (clang, -O0):
<mgh_umck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x11,%eax
ja     14ab <mgh_umck+0x39b>
mov    -0x20(%rbp),%rax
lea    0xeb7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xedf(%rip),%rdx
lea    0xef1(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x6,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xee8(%rip),%rdx
lea    0xef6(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xeed(%rip),%rdx
lea    0xef9(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x2,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xef0(%rip),%rdx
lea    0xf07(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xefe(%rip),%rdx
lea    0xf13(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x1,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf0a(%rip),%rdx
lea    0xf22(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x2,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf1b(%rip),%rdx
lea    0xf25(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x1,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf3c(%rip),%rdx
lea    0xf49(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x1,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf42(%rip),%rdx
lea    0xf50(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x2,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf49(%rip),%rdx
lea    0xf5f(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x4,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf57(%rip),%rdx
lea    0xf6b(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf63(%rip),%rdx
lea    0xf84(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x1,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf7c(%rip),%rdx
lea    0xf8d(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x21(%rbp)
jl     13a4 <mgh_umck+0x294>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf68(%rip),%rdx
lea    0xf7f(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x22(%rbp)
jl     13ee <mgh_umck+0x2de>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf65(%rip),%rdx
lea    0xf78(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x2,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf7d(%rip),%rdx
lea    0xf86(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
cmpl   $0x4,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf7e(%rip),%rdx
lea    0xf86(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x23(%rbp)
jl     1484 <mgh_umck+0x374>
cmpl   $0x32,-0xc(%rbp)
setle  %al
mov    %al,-0x23(%rbp)
mov    -0x23(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x8(%rbp),%rsi
lea    0xf69(%rip),%rdx
lea    0xf76(%rip),%rcx
call   1030 <check@plt>
mov    %eax,-0x14(%rbp)
jmp    14d0 <mgh_umck+0x3c0>
movl   $0xffffffff,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     14cb <mgh_umck+0x3bb>
mov    -0x8(%rbp),%rax
lea    0xf6c(%rip),%rcx
mov    %rcx,(%rax)
jmp    14d0 <mgh_umck+0x3c0>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgh_umck>:
mov    %rdi,%rax
add    $0xffffffff,%edx
cmp    $0x11,%edx
ja     114a <mgh_umck+0x3a>
lea    0xede(%rip),%rcx
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
xor    %edi,%edi
cmp    $0x3,%esi
sete   %dil
lea    0xf0d(%rip),%rdx
lea    0xf1f(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
test   %rax,%rax
je     1159 <mgh_umck+0x49>
lea    0x12de(%rip),%rcx
mov    %rcx,(%rax)
mov    $0xffffffff,%eax
ret
xor    %edi,%edi
cmp    $0x6,%esi
sete   %dil
lea    0xf0d(%rip),%rdx
lea    0xf1b(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x3,%esi
sete   %dil
lea    0xf1e(%rip),%rdx
lea    0xf2a(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x2,%esi
sete   %dil
lea    0xf2d(%rip),%rdx
lea    0xf44(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x3,%esi
sete   %dil
lea    0xf47(%rip),%rdx
lea    0xf5c(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
test   %esi,%esi
setg   %dil
lea    0xf60(%rip),%rdx
lea    0xf78(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x2,%esi
setge  %dil
lea    0xf7d(%rip),%rdx
lea    0xf87(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
test   %esi,%esi
setg   %dil
lea    0xfab(%rip),%rdx
lea    0xfb8(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
test   %esi,%esi
setg   %dil
lea    0xfbe(%rip),%rdx
lea    0xfcc(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x2,%esi
sete   %dil
lea    0xfd1(%rip),%rdx
lea    0xfe7(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x4,%esi
sete   %dil
lea    0xfeb(%rip),%rdx
lea    0xfff(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x3,%esi
sete   %dil
lea    0x1003(%rip),%rdx
lea    0x1024(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
test   %esi,%esi
setg   %dil
lea    0x1029(%rip),%rdx
lea    0x103a(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
mov    %esi,%ecx
not    %ecx
and    $0x1,%ecx
xor    %edi,%edi
test   %esi,%esi
cmovg  %ecx,%edi
lea    0x103b(%rip),%rdx
lea    0x1052(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
test   %esi,%esi
setg   %cl
test   $0x3,%sil
sete   %dl
and    %cl,%dl
movzbl %dl,%edi
lea    0x105b(%rip),%rdx
lea    0x106e(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x2,%esi
sete   %dil
lea    0x107f(%rip),%rdx
lea    0x1088(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
xor    %edi,%edi
cmp    $0x4,%esi
sete   %dil
lea    0x108c(%rip),%rdx
lea    0x1094(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>
add    $0xffffffff,%esi
xor    %edi,%edi
cmp    $0x32,%esi
setb   %dil
lea    0x1095(%rip),%rdx
lea    0x10a2(%rip),%rcx
mov    %rax,%rsi
jmp    1030 <check@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Helical valley function.\00"
@.str.1 = [27 x i8] c"N must be 3 for problem\00"
@.str.2 = [21 x i8] c"Biggs exp6 function.\00"
@.str.3 = [27 x i8] c"N must be 6 for problem\00"
@.str.4 = [19 x i8] c"Gaussian function.\00"
@.str.5 = [27 x i8] c"N must be 3 for problem\00"
@.str.6 = [30 x i8] c"Powell badly scaled function.\00"
@.str.7 = [27 x i8] c"N must be 2 for problem\00"
@.str.8 = [28 x i8] c"Box 3-dimensional function.\00"
@.str.9 = [27 x i8] c"N must be 3 for problem\00"
@.str.10 = [31 x i8] c"Variably dimensioned function.\00"
@.str.11 = [29 x i8] c"N must be >= 1 in problem\00"
@.str.12 = [17 x i8] c"Watson function.\00"
@.str.13 = [59 x i8] c"N may be 2 or greater but is usually 6 or 9 for problem\00"
@.str.14 = [20 x i8] c"Penalty function I.\00"
@.str.15 = [29 x i8] c"N must be >= 1 in problem\00"
@.str.16 = [21 x i8] c"Penalty function II.\00"
@.str.17 = [29 x i8] c"N must be >= 1 in problem\00"
@.str.18 = [29 x i8] c"Brown badly scaled function.\00"
@.str.19 = [28 x i8] c"N must be 2 for problem\00"
@.str.20 = [27 x i8] c"Brown and Dennis function.\00"
@.str.21 = [28 x i8] c"N must be 4 for problem\00"
@.str.22 = [40 x i8] c"Gulf research and development function.\00"
@.str.23 = [28 x i8] c"N must be 3 for problem\00"
@.str.24 = [24 x i8] c"Trigonometric function.\00"
@.str.25 = [30 x i8] c"N must be >= 1 in problem\00"
@.str.26 = [30 x i8] c"Extended Rosenbrock function.\00"
@.str.27 = [41 x i8] c"N must be a multiple of 2 in problem\00"
@.str.28 = [26 x i8] c"Extended Powell function.\00"
@.str.29 = [41 x i8] c"N must be a multiple of 4 in problem\00"
@.str.30 = [16 x i8] c"Beale function.\00"
@.str.31 = [28 x i8] c"N must be 2 for problem\00"
@.str.32 = [15 x i8] c"Wood function.\00"
@.str.33 = [28 x i8] c"N must be 4 for problem\00"
@.str.34 = [20 x i8] c"Chebyquad function.\00"
@.str.35 = [32 x i8] c"N must be <= 50 for problem\00"
@.str.36 = [41 x i8] c"PROB must be an integer between 1 and 18\00"
define i32 @mgh_umck(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %6
switch i32 %8, label %134 [
i32 1, label %9
i32 2, label %15
i32 3, label %21
i32 4, label %27
i32 5, label %33
i32 6, label %39
i32 7, label %45
i32 8, label %51
i32 9, label %57
i32 10, label %63
i32 11, label %69
i32 12, label %75
i32 13, label %81
i32 14, label %87
i32 15, label %99
i32 16, label %111
i32 17, label %117
i32 18, label %123
]
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 3
%12 = zext i1 %11 to i32
%13 = load i8**, i8*** %4
%14 = call i32 @check(i32 %12, i8** %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 %14, i32* %7
br label %140
15: ; preds = %3
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 6
%18 = zext i1 %17 to i32
%19 = load i8**, i8*** %4
%20 = call i32 @check(i32 %18, i8** %19, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
store i32 %20, i32* %7
br label %140
21: ; preds = %3
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 3
%24 = zext i1 %23 to i32
%25 = load i8**, i8*** %4
%26 = call i32 @check(i32 %24, i8** %25, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
store i32 %26, i32* %7
br label %140
27: ; preds = %3
%28 = load i32, i32* %5
%29 = icmp eq i32 %28, 2
%30 = zext i1 %29 to i32
%31 = load i8**, i8*** %4
%32 = call i32 @check(i32 %30, i8** %31, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
store i32 %32, i32* %7
br label %140
33: ; preds = %3
%34 = load i32, i32* %5
%35 = icmp eq i32 %34, 3
%36 = zext i1 %35 to i32
%37 = load i8**, i8*** %4
%38 = call i32 @check(i32 %36, i8** %37, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
store i32 %38, i32* %7
br label %140
39: ; preds = %3
%40 = load i32, i32* %5
%41 = icmp sge i32 %40, 1
%42 = zext i1 %41 to i32
%43 = load i8**, i8*** %4
%44 = call i32 @check(i32 %42, i8** %43, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
store i32 %44, i32* %7
br label %140
45: ; preds = %3
%46 = load i32, i32* %5
%47 = icmp sge i32 %46, 2
%48 = zext i1 %47 to i32
%49 = load i8**, i8*** %4
%50 = call i32 @check(i32 %48, i8** %49, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.13, i64 0, i64 0))
store i32 %50, i32* %7
br label %140
51: ; preds = %3
%52 = load i32, i32* %5
%53 = icmp sge i32 %52, 1
%54 = zext i1 %53 to i32
%55 = load i8**, i8*** %4
%56 = call i32 @check(i32 %54, i8** %55, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
store i32 %56, i32* %7
br label %140
57: ; preds = %3
%58 = load i32, i32* %5
%59 = icmp sge i32 %58, 1
%60 = zext i1 %59 to i32
%61 = load i8**, i8*** %4
%62 = call i32 @check(i32 %60, i8** %61, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.17, i64 0, i64 0))
store i32 %62, i32* %7
br label %140
63: ; preds = %3
%64 = load i32, i32* %5
%65 = icmp eq i32 %64, 2
%66 = zext i1 %65 to i32
%67 = load i8**, i8*** %4
%68 = call i32 @check(i32 %66, i8** %67, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0))
store i32 %68, i32* %7
br label %140
69: ; preds = %3
%70 = load i32, i32* %5
%71 = icmp eq i32 %70, 4
%72 = zext i1 %71 to i32
%73 = load i8**, i8*** %4
%74 = call i32 @check(i32 %72, i8** %73, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0))
store i32 %74, i32* %7
br label %140
75: ; preds = %3
%76 = load i32, i32* %5
%77 = icmp eq i32 %76, 3
%78 = zext i1 %77 to i32
%79 = load i8**, i8*** %4
%80 = call i32 @check(i32 %78, i8** %79, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i64 0, i64 0))
store i32 %80, i32* %7
br label %140
81: ; preds = %3
%82 = load i32, i32* %5
%83 = icmp sge i32 %82, 1
%84 = zext i1 %83 to i32
%85 = load i8**, i8*** %4
%86 = call i32 @check(i32 %84, i8** %85, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.25, i64 0, i64 0))
store i32 %86, i32* %7
br label %140
87: ; preds = %3
%88 = load i32, i32* %5
%89 = icmp sge i32 %88, 1
br i1 %89, label %90, label %94
90: ; preds = %87
%91 = load i32, i32* %5
%92 = srem i32 %91, 2
%93 = icmp eq i32 %92, 0
br label %94
94: ; preds = %90, %87
%95 = phi i1 [ false, %87 ], [ %93, %90 ]
%96 = zext i1 %95 to i32
%97 = load i8**, i8*** %4
%98 = call i32 @check(i32 %96, i8** %97, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.27, i64 0, i64 0))
store i32 %98, i32* %7
br label %140
99: ; preds = %3
%100 = load i32, i32* %5
%101 = icmp sge i32 %100, 1
br i1 %101, label %102, label %106
102: ; preds = %99
%103 = load i32, i32* %5
%104 = srem i32 %103, 4
%105 = icmp eq i32 %104, 0
br label %106
106: ; preds = %102, %99
%107 = phi i1 [ false, %99 ], [ %105, %102 ]
%108 = zext i1 %107 to i32
%109 = load i8**, i8*** %4
%110 = call i32 @check(i32 %108, i8** %109, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.29, i64 0, i64 0))
store i32 %110, i32* %7
br label %140
111: ; preds = %3
%112 = load i32, i32* %5
%113 = icmp eq i32 %112, 2
%114 = zext i1 %113 to i32
%115 = load i8**, i8*** %4
%116 = call i32 @check(i32 %114, i8** %115, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.30, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0))
store i32 %116, i32* %7
br label %140
117: ; preds = %3
%118 = load i32, i32* %5
%119 = icmp eq i32 %118, 4
%120 = zext i1 %119 to i32
%121 = load i8**, i8*** %4
%122 = call i32 @check(i32 %120, i8** %121, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.32, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.33, i64 0, i64 0))
store i32 %122, i32* %7
br label %140
123: ; preds = %3
%124 = load i32, i32* %5
%125 = icmp sge i32 %124, 1
br i1 %125, label %126, label %129
126: ; preds = %123
%127 = load i32, i32* %5
%128 = icmp sle i32 %127, 50
br label %129
129: ; preds = %126, %123
%130 = phi i1 [ false, %123 ], [ %128, %126 ]
%131 = zext i1 %130 to i32
%132 = load i8**, i8*** %4
%133 = call i32 @check(i32 %131, i8** %132, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.34, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.35, i64 0, i64 0))
store i32 %133, i32* %7
br label %140
134: ; preds = %3
store i32 -1, i32* %7
%135 = load i8**, i8*** %4
%136 = icmp ne i8** %135, null
br i1 %136, label %137, label %139
137: ; preds = %134
%138 = load i8**, i8*** %4
store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.36, i64 0, i64 0), i8** %138
br label %139
139: ; preds = %137, %134
br label %140
140: ; preds = %139, %129, %117, %111, %106, %94, %81, %75, %69, %63, %57, %51, %45, %39, %33, %27, %21, %15, %9
%141 = load i32, i32* %7
ret i32 %141
}

LLVM IR (-O2):
@.str = [25 x i8] c"Helical valley function.\00"
@.str.1 = [27 x i8] c"N must be 3 for problem\00"
@.str.2 = [21 x i8] c"Biggs exp6 function.\00"
@.str.3 = [27 x i8] c"N must be 6 for problem\00"
@.str.4 = [19 x i8] c"Gaussian function.\00"
@.str.5 = [27 x i8] c"N must be 3 for problem\00"
@.str.6 = [30 x i8] c"Powell badly scaled function.\00"
@.str.7 = [27 x i8] c"N must be 2 for problem\00"
@.str.8 = [28 x i8] c"Box 3-dimensional function.\00"
@.str.9 = [27 x i8] c"N must be 3 for problem\00"
@.str.10 = [31 x i8] c"Variably dimensioned function.\00"
@.str.11 = [29 x i8] c"N must be >= 1 in problem\00"
@.str.12 = [17 x i8] c"Watson function.\00"
@.str.13 = [59 x i8] c"N may be 2 or greater but is usually 6 or 9 for problem\00"
@.str.14 = [20 x i8] c"Penalty function I.\00"
@.str.15 = [29 x i8] c"N must be >= 1 in problem\00"
@.str.16 = [21 x i8] c"Penalty function II.\00"
@.str.17 = [29 x i8] c"N must be >= 1 in problem\00"
@.str.18 = [29 x i8] c"Brown badly scaled function.\00"
@.str.19 = [28 x i8] c"N must be 2 for problem\00"
@.str.20 = [27 x i8] c"Brown and Dennis function.\00"
@.str.21 = [28 x i8] c"N must be 4 for problem\00"
@.str.22 = [40 x i8] c"Gulf research and development function.\00"
@.str.23 = [28 x i8] c"N must be 3 for problem\00"
@.str.24 = [24 x i8] c"Trigonometric function.\00"
@.str.25 = [30 x i8] c"N must be >= 1 in problem\00"
@.str.26 = [30 x i8] c"Extended Rosenbrock function.\00"
@.str.27 = [41 x i8] c"N must be a multiple of 2 in problem\00"
@.str.28 = [26 x i8] c"Extended Powell function.\00"
@.str.29 = [41 x i8] c"N must be a multiple of 4 in problem\00"
@.str.30 = [16 x i8] c"Beale function.\00"
@.str.31 = [28 x i8] c"N must be 2 for problem\00"
@.str.32 = [15 x i8] c"Wood function.\00"
@.str.33 = [28 x i8] c"N must be 4 for problem\00"
@.str.34 = [20 x i8] c"Chebyquad function.\00"
@.str.35 = [32 x i8] c"N must be <= 50 for problem\00"
@.str.36 = [41 x i8] c"PROB must be an integer between 1 and 18\00"
define i32 @mgh_umck(i8** %0, i32 %1, i32 %2) {
switch i32 %2, label %82 [
i32 1, label %4
i32 2, label %8
i32 3, label %12
i32 4, label %16
i32 5, label %20
i32 6, label %24
i32 7, label %28
i32 8, label %32
i32 9, label %36
i32 10, label %40
i32 11, label %44
i32 12, label %48
i32 13, label %52
i32 14, label %56
i32 15, label %62
i32 16, label %69
i32 17, label %73
i32 18, label %77
]
4: ; preds = %3
%5 = icmp eq i32 %1, 3
%6 = zext i1 %5 to i32
%7 = tail call i32 @check(i32 %6, i8** %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %85
8: ; preds = %3
%9 = icmp eq i32 %1, 6
%10 = zext i1 %9 to i32
%11 = tail call i32 @check(i32 %10, i8** %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %85
12: ; preds = %3
%13 = icmp eq i32 %1, 3
%14 = zext i1 %13 to i32
%15 = tail call i32 @check(i32 %14, i8** %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %85
16: ; preds = %3
%17 = icmp eq i32 %1, 2
%18 = zext i1 %17 to i32
%19 = tail call i32 @check(i32 %18, i8** %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
br label %85
20: ; preds = %3
%21 = icmp eq i32 %1, 3
%22 = zext i1 %21 to i32
%23 = tail call i32 @check(i32 %22, i8** %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %85
24: ; preds = %3
%25 = icmp sgt i32 %1, 0
%26 = zext i1 %25 to i32
%27 = tail call i32 @check(i32 %26, i8** %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
br label %85
28: ; preds = %3
%29 = icmp sgt i32 %1, 1
%30 = zext i1 %29 to i32
%31 = tail call i32 @check(i32 %30, i8** %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.13, i64 0, i64 0))
br label %85
32: ; preds = %3
%33 = icmp sgt i32 %1, 0
%34 = zext i1 %33 to i32
%35 = tail call i32 @check(i32 %34, i8** %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
br label %85
36: ; preds = %3
%37 = icmp sgt i32 %1, 0
%38 = zext i1 %37 to i32
%39 = tail call i32 @check(i32 %38, i8** %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.17, i64 0, i64 0))
br label %85
40: ; preds = %3
%41 = icmp eq i32 %1, 2
%42 = zext i1 %41 to i32
%43 = tail call i32 @check(i32 %42, i8** %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0))
br label %85
44: ; preds = %3
%45 = icmp eq i32 %1, 4
%46 = zext i1 %45 to i32
%47 = tail call i32 @check(i32 %46, i8** %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0))
br label %85
48: ; preds = %3
%49 = icmp eq i32 %1, 3
%50 = zext i1 %49 to i32
%51 = tail call i32 @check(i32 %50, i8** %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i64 0, i64 0))
br label %85
52: ; preds = %3
%53 = icmp sgt i32 %1, 0
%54 = zext i1 %53 to i32
%55 = tail call i32 @check(i32 %54, i8** %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.25, i64 0, i64 0))
br label %85
56: ; preds = %3
%57 = icmp sgt i32 %1, 0
%58 = and i32 %1, 1
%59 = xor i32 %58, 1
%60 = select i1 %57, i32 %59, i32 0
%61 = tail call i32 @check(i32 %60, i8** %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.27, i64 0, i64 0))
br label %85
62: ; preds = %3
%63 = icmp sgt i32 %1, 0
%64 = and i32 %1, 3
%65 = icmp eq i32 %64, 0
%66 = and i1 %63, %65
%67 = zext i1 %66 to i32
%68 = tail call i32 @check(i32 %67, i8** %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.29, i64 0, i64 0))
br label %85
69: ; preds = %3
%70 = icmp eq i32 %1, 2
%71 = zext i1 %70 to i32
%72 = tail call i32 @check(i32 %71, i8** %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.30, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0))
br label %85
73: ; preds = %3
%74 = icmp eq i32 %1, 4
%75 = zext i1 %74 to i32
%76 = tail call i32 @check(i32 %75, i8** %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.32, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.33, i64 0, i64 0))
br label %85
77: ; preds = %3
%78 = add i32 %1, -1
%79 = icmp ult i32 %78, 50
%80 = zext i1 %79 to i32
%81 = tail call i32 @check(i32 %80, i8** %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.34, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.35, i64 0, i64 0))
br label %85
82: ; preds = %3
%83 = icmp eq i8** %0, null
br i1 %83, label %85, label %84
84: ; preds = %82
store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.36, i64 0, i64 0), i8** %0
br label %85
85: ; preds = %82, %84, %77, %73, %69, %62, %56, %52, %48, %44, %40, %36, %32, %28, %24, %20, %16, %12, %8, %4
%86 = phi i32 [ -1, %84 ], [ -1, %82 ], [ %81, %77 ], [ %76, %73 ], [ %72, %69 ], [ %68, %62 ], [ %61, %56 ], [ %55, %52 ], [ %51, %48 ], [ %47, %44 ], [ %43, %40 ], [ %39, %36 ], [ %35, %32 ], [ %31, %28 ], [ %27, %24 ], [ %23, %20 ], [ %19, %16 ], [ %15, %12 ], [ %11, %8 ], [ %7, %4 ]
ret i32 %86
}