#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 /*<<< orphan*/ config_store_set_val(int, int);
int /*<<< orphan*/ cvproc_set_pair_mode(int, int);
int /*<<< orphan*/ cvproc_set_pairs(int);
int /*<<< orphan*/ log_error(char *, int);
void iface_midi_router_set_program(int prog) {
  if (prog < 0 || prog > 21) {
    log_error("imrsp - prog invalid: %d", prog);
    return;
  }
  config_store_set_val(1, prog);
  switch (prog) {
  case 0:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -1);
    cvproc_set_pair_mode(2, -1);
    cvproc_set_pair_mode(3, -1);
    break;
  case 1:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -2);
    cvproc_set_pair_mode(2, -1);
    cvproc_set_pair_mode(3, -1);
    break;
  case 2:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -2);
    cvproc_set_pair_mode(2, -1);
    cvproc_set_pair_mode(3, -2);
    break;
  case 3:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, -2);
    cvproc_set_pair_mode(1, -2);
    cvproc_set_pair_mode(2, -2);
    cvproc_set_pair_mode(3, -2);
    break;
  case 4:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -1);
    cvproc_set_pair_mode(2, 1);
    cvproc_set_pair_mode(3, 16);
    break;
  case 5:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -2);
    cvproc_set_pair_mode(2, 1);
    cvproc_set_pair_mode(3, 16);
    break;
  case 6:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, 16);
    cvproc_set_pair_mode(2, 17);
    cvproc_set_pair_mode(3, 18);
    break;
  case 7:
    cvproc_set_pairs(0);
    cvproc_set_pair_mode(0, 1);
    cvproc_set_pair_mode(1, 16);
    cvproc_set_pair_mode(2, 17);
    cvproc_set_pair_mode(3, 18);
    break;
  case 8:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -1);
    cvproc_set_pair_mode(2, -1);
    break;
  case 9:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -1);
    cvproc_set_pair_mode(2, -2);
    break;
  case 10:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -2);
    cvproc_set_pair_mode(1, -1);
    cvproc_set_pair_mode(2, -1);
    break;
  case 11:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -2);
    cvproc_set_pair_mode(1, -2);
    cvproc_set_pair_mode(2, -2);
    break;
  case 12:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -1);
    cvproc_set_pair_mode(2, 1);
    break;
  case 13:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -2);
    cvproc_set_pair_mode(2, 1);
    break;
  case 14:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, 1);
    cvproc_set_pair_mode(2, 16);
    break;
  case 15:
    cvproc_set_pairs(1);
    cvproc_set_pair_mode(0, -2);
    cvproc_set_pair_mode(1, 1);
    cvproc_set_pair_mode(2, 16);
    break;
  case 16:
    cvproc_set_pairs(2);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -1);
    break;
  case 17:
    cvproc_set_pairs(2);
    cvproc_set_pair_mode(0, -1);
    cvproc_set_pair_mode(1, -2);
    break;
  case 18:
    cvproc_set_pairs(2);
    cvproc_set_pair_mode(0, -2);
    cvproc_set_pair_mode(1, -2);
    break;
  case 19:
    cvproc_set_pairs(3);
    cvproc_set_pair_mode(0, -1);
    break;
  case 20:
    cvproc_set_pairs(3);
    cvproc_set_pair_mode(0, -2);
    break;
  }
}


x86 assembly (clang, -O0):
<iface_midi_router_set_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     115f <iface_midi_router_set_program+0x1f>
cmpl   $0x15,-0x4(%rbp)
jle    1173 <iface_midi_router_set_program+0x33>
mov    -0x4(%rbp),%esi
lea    0xeeb(%rip),%rdi
call   1030 <log_error@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <config_store_set_val@plt>
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x14,%rax
ja     163e <iface_midi_router_set_program+0x4fe>
mov    -0x10(%rbp),%rax
lea    0xe64(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0x10,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0x10,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0x10,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x11,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0x12,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0x10,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x11,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0x12,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x10,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x10,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x2,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x2,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x2,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x3,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
jmp    163e <iface_midi_router_set_program+0x4fe>
mov    $0x3,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iface_midi_router_set_program>:
push   %rbx
mov    %edi,%ebx
cmp    $0x16,%edi
jb     1157 <iface_midi_router_set_program+0x17>
lea    0xf05(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <log_error@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <config_store_set_val@plt>
cmp    $0x14,%ebx
ja     1199 <iface_midi_router_set_program+0x59>
mov    %ebx,%eax
lea    0xe8f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
jmp    11b8 <iface_midi_router_set_program+0x78>
pop    %rbx
ret
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
jmp    1475 <iface_midi_router_set_program+0x335>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xffffffff,%esi
jmp    1230 <iface_midi_router_set_program+0xf0>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
jmp    148c <iface_midi_router_set_program+0x34c>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
jmp    127b <iface_midi_router_set_program+0x13b>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
jmp    1411 <iface_midi_router_set_program+0x2d1>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
jmp    12b7 <iface_midi_router_set_program+0x177>
xor    %edi,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0x10,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x11,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
mov    $0x12,%esi
pop    %rbx
jmp    1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
jmp    1330 <iface_midi_router_set_program+0x1f0>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
jmp    136e <iface_midi_router_set_program+0x22e>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
jmp    1475 <iface_midi_router_set_program+0x335>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
jmp    148c <iface_midi_router_set_program+0x34c>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
jmp    13bf <iface_midi_router_set_program+0x27f>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
jmp    13f8 <iface_midi_router_set_program+0x2b8>
mov    $0x1,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
mov    $0x10,%esi
pop    %rbx
jmp    1050 <cvproc_set_pair_mode@plt>
mov    $0x2,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
jmp    1475 <iface_midi_router_set_program+0x335>
mov    $0x2,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
jmp    145d <iface_midi_router_set_program+0x31d>
mov    $0x2,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1050 <cvproc_set_pair_mode@plt>
mov    $0x1,%edi
jmp    148c <iface_midi_router_set_program+0x34c>
mov    $0x3,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1050 <cvproc_set_pair_mode@plt>
mov    $0x3,%edi
call   1060 <cvproc_set_pairs@plt>
xor    %edi,%edi
mov    $0xfffffffe,%esi
pop    %rbx
jmp    1050 <cvproc_set_pair_mode@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"imrsp - prog invalid: %d\00"
define void @iface_midi_router_set_program(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 21
br i1 %7, label %8, label %11
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i32 @log_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %121
11: ; preds = %5
%12 = load i32, i32* %2
%13 = call i32 @config_store_set_val(i32 1, i32 %12)
%14 = load i32, i32* %2
switch i32 %14, label %121 [
i32 0, label %15
i32 1, label %21
i32 2, label %27
i32 3, label %33
i32 4, label %39
i32 5, label %45
i32 6, label %51
i32 7, label %57
i32 8, label %63
i32 9, label %68
i32 10, label %73
i32 11, label %78
i32 12, label %83
i32 13, label %88
i32 14, label %93
i32 15, label %98
i32 16, label %103
i32 17, label %107
i32 18, label %111
i32 19, label %115
i32 20, label %118
]
15: ; preds = %11
%16 = call i32 @cvproc_set_pairs(i32 0)
%17 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%18 = call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%19 = call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
%20 = call i32 @cvproc_set_pair_mode(i32 3, i32 -1)
br label %121
21: ; preds = %11
%22 = call i32 @cvproc_set_pairs(i32 0)
%23 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%24 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%25 = call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
%26 = call i32 @cvproc_set_pair_mode(i32 3, i32 -1)
br label %121
27: ; preds = %11
%28 = call i32 @cvproc_set_pairs(i32 0)
%29 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%30 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%31 = call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
%32 = call i32 @cvproc_set_pair_mode(i32 3, i32 -2)
br label %121
33: ; preds = %11
%34 = call i32 @cvproc_set_pairs(i32 0)
%35 = call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%36 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%37 = call i32 @cvproc_set_pair_mode(i32 2, i32 -2)
%38 = call i32 @cvproc_set_pair_mode(i32 3, i32 -2)
br label %121
39: ; preds = %11
%40 = call i32 @cvproc_set_pairs(i32 0)
%41 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%42 = call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%43 = call i32 @cvproc_set_pair_mode(i32 2, i32 1)
%44 = call i32 @cvproc_set_pair_mode(i32 3, i32 16)
br label %121
45: ; preds = %11
%46 = call i32 @cvproc_set_pairs(i32 0)
%47 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%48 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%49 = call i32 @cvproc_set_pair_mode(i32 2, i32 1)
%50 = call i32 @cvproc_set_pair_mode(i32 3, i32 16)
br label %121
51: ; preds = %11
%52 = call i32 @cvproc_set_pairs(i32 0)
%53 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%54 = call i32 @cvproc_set_pair_mode(i32 1, i32 16)
%55 = call i32 @cvproc_set_pair_mode(i32 2, i32 17)
%56 = call i32 @cvproc_set_pair_mode(i32 3, i32 18)
br label %121
57: ; preds = %11
%58 = call i32 @cvproc_set_pairs(i32 0)
%59 = call i32 @cvproc_set_pair_mode(i32 0, i32 1)
%60 = call i32 @cvproc_set_pair_mode(i32 1, i32 16)
%61 = call i32 @cvproc_set_pair_mode(i32 2, i32 17)
%62 = call i32 @cvproc_set_pair_mode(i32 3, i32 18)
br label %121
63: ; preds = %11
%64 = call i32 @cvproc_set_pairs(i32 1)
%65 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%66 = call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%67 = call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
br label %121
68: ; preds = %11
%69 = call i32 @cvproc_set_pairs(i32 1)
%70 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%71 = call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%72 = call i32 @cvproc_set_pair_mode(i32 2, i32 -2)
br label %121
73: ; preds = %11
%74 = call i32 @cvproc_set_pairs(i32 1)
%75 = call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%76 = call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%77 = call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
br label %121
78: ; preds = %11
%79 = call i32 @cvproc_set_pairs(i32 1)
%80 = call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%81 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%82 = call i32 @cvproc_set_pair_mode(i32 2, i32 -2)
br label %121
83: ; preds = %11
%84 = call i32 @cvproc_set_pairs(i32 1)
%85 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%86 = call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%87 = call i32 @cvproc_set_pair_mode(i32 2, i32 1)
br label %121
88: ; preds = %11
%89 = call i32 @cvproc_set_pairs(i32 1)
%90 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%91 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%92 = call i32 @cvproc_set_pair_mode(i32 2, i32 1)
br label %121
93: ; preds = %11
%94 = call i32 @cvproc_set_pairs(i32 1)
%95 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%96 = call i32 @cvproc_set_pair_mode(i32 1, i32 1)
%97 = call i32 @cvproc_set_pair_mode(i32 2, i32 16)
br label %121
98: ; preds = %11
%99 = call i32 @cvproc_set_pairs(i32 1)
%100 = call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%101 = call i32 @cvproc_set_pair_mode(i32 1, i32 1)
%102 = call i32 @cvproc_set_pair_mode(i32 2, i32 16)
br label %121
103: ; preds = %11
%104 = call i32 @cvproc_set_pairs(i32 2)
%105 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%106 = call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
br label %121
107: ; preds = %11
%108 = call i32 @cvproc_set_pairs(i32 2)
%109 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%110 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
br label %121
111: ; preds = %11
%112 = call i32 @cvproc_set_pairs(i32 2)
%113 = call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%114 = call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
br label %121
115: ; preds = %11
%116 = call i32 @cvproc_set_pairs(i32 3)
%117 = call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
br label %121
118: ; preds = %11
%119 = call i32 @cvproc_set_pairs(i32 3)
%120 = call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
br label %121
121: ; preds = %8, %11, %118, %115, %111, %107, %103, %98, %93, %88, %83, %78, %73, %68, %63, %57, %51, %45, %39, %33, %27, %21, %15
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"imrsp - prog invalid: %d\00"
define void @iface_midi_router_set_program(i32 %0) {
%2 = icmp ugt i32 %0, 21
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @log_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %113
5: ; preds = %1
%6 = tail call i32 @config_store_set_val(i32 1, i32 %0)
switch i32 %0, label %113 [
i32 0, label %7
i32 1, label %13
i32 2, label %19
i32 3, label %25
i32 4, label %31
i32 5, label %37
i32 6, label %43
i32 7, label %49
i32 8, label %55
i32 9, label %60
i32 10, label %65
i32 11, label %70
i32 12, label %75
i32 13, label %80
i32 14, label %85
i32 15, label %90
i32 16, label %95
i32 17, label %99
i32 18, label %103
i32 19, label %107
i32 20, label %110
]
7: ; preds = %5
%8 = tail call i32 @cvproc_set_pairs(i32 0)
%9 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%10 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%11 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
%12 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 -1)
br label %113
13: ; preds = %5
%14 = tail call i32 @cvproc_set_pairs(i32 0)
%15 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%16 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%17 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
%18 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 -1)
br label %113
19: ; preds = %5
%20 = tail call i32 @cvproc_set_pairs(i32 0)
%21 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%22 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%23 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
%24 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 -2)
br label %113
25: ; preds = %5
%26 = tail call i32 @cvproc_set_pairs(i32 0)
%27 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%28 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%29 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -2)
%30 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 -2)
br label %113
31: ; preds = %5
%32 = tail call i32 @cvproc_set_pairs(i32 0)
%33 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%34 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%35 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 1)
%36 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 16)
br label %113
37: ; preds = %5
%38 = tail call i32 @cvproc_set_pairs(i32 0)
%39 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%40 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%41 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 1)
%42 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 16)
br label %113
43: ; preds = %5
%44 = tail call i32 @cvproc_set_pairs(i32 0)
%45 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%46 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 16)
%47 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 17)
%48 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 18)
br label %113
49: ; preds = %5
%50 = tail call i32 @cvproc_set_pairs(i32 0)
%51 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 1)
%52 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 16)
%53 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 17)
%54 = tail call i32 @cvproc_set_pair_mode(i32 3, i32 18)
br label %113
55: ; preds = %5
%56 = tail call i32 @cvproc_set_pairs(i32 1)
%57 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%58 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%59 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
br label %113
60: ; preds = %5
%61 = tail call i32 @cvproc_set_pairs(i32 1)
%62 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%63 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%64 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -2)
br label %113
65: ; preds = %5
%66 = tail call i32 @cvproc_set_pairs(i32 1)
%67 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%68 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%69 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -1)
br label %113
70: ; preds = %5
%71 = tail call i32 @cvproc_set_pairs(i32 1)
%72 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%73 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%74 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 -2)
br label %113
75: ; preds = %5
%76 = tail call i32 @cvproc_set_pairs(i32 1)
%77 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%78 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
%79 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 1)
br label %113
80: ; preds = %5
%81 = tail call i32 @cvproc_set_pairs(i32 1)
%82 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%83 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
%84 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 1)
br label %113
85: ; preds = %5
%86 = tail call i32 @cvproc_set_pairs(i32 1)
%87 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%88 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 1)
%89 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 16)
br label %113
90: ; preds = %5
%91 = tail call i32 @cvproc_set_pairs(i32 1)
%92 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%93 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 1)
%94 = tail call i32 @cvproc_set_pair_mode(i32 2, i32 16)
br label %113
95: ; preds = %5
%96 = tail call i32 @cvproc_set_pairs(i32 2)
%97 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%98 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -1)
br label %113
99: ; preds = %5
%100 = tail call i32 @cvproc_set_pairs(i32 2)
%101 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
%102 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
br label %113
103: ; preds = %5
%104 = tail call i32 @cvproc_set_pairs(i32 2)
%105 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
%106 = tail call i32 @cvproc_set_pair_mode(i32 1, i32 -2)
br label %113
107: ; preds = %5
%108 = tail call i32 @cvproc_set_pairs(i32 3)
%109 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -1)
br label %113
110: ; preds = %5
%111 = tail call i32 @cvproc_set_pairs(i32 3)
%112 = tail call i32 @cvproc_set_pair_mode(i32 0, i32 -2)
br label %113
113: ; preds = %3, %5, %110, %107, %103, %99, %95, %90, %85, %80, %75, %70, %65, %60, %55, %49, %43, %37, %31, %25, %19, %13, %7
ret void
}