#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 direction(int, char *);
int exportIO(int);
int setDigital(int, int);
int enableAnalog(unsigned char n) {
  int r;
  switch (n) {
  case 0:
    r = exportIO(37);
    r += direction(37, "out");
    r += setDigital(37, 0);
    return r;
    break;
  case 1:
    r = exportIO(36);
    r += direction(36, "out");
    r += setDigital(36, 0);
    return r;
    break;
  case 2:
    r = exportIO(23);
    r += direction(23, "out");
    r += setDigital(23, 0);
    return r;
    break;
  case 3:
    r = exportIO(22);
    r += direction(22, "out");
    r += setDigital(22, 0);
    return r;
    break;
  case 4:
    r = exportIO(21);
    r += direction(21, "out");
    r += setDigital(21, 0);
    r += exportIO(29);
    r += direction(29, "out");
    r += setDigital(29, 1);
    return r;
    break;
  case 5:
    r = exportIO(20);
    r += direction(20, "out");
    r += setDigital(20, 0);
    r += exportIO(29);
    r += direction(29, "out");
    r += setDigital(29, 1);
    return r;
    break;
  default:
    return -1;
    break;
  }
}


x86 assembly (clang, -O0):
<enableAnalog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     1362 <enableAnalog+0x232>
mov    -0x18(%rbp),%rax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x25,%edi
call   1050 <exportIO@plt>
mov    %eax,-0xc(%rbp)
mov    $0x25,%edi
lea    0xe9b(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x25,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1369 <enableAnalog+0x239>
mov    $0x24,%edi
call   1050 <exportIO@plt>
mov    %eax,-0xc(%rbp)
mov    $0x24,%edi
lea    0xe5a(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x24,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1369 <enableAnalog+0x239>
mov    $0x17,%edi
call   1050 <exportIO@plt>
mov    %eax,-0xc(%rbp)
mov    $0x17,%edi
lea    0xe19(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x17,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1369 <enableAnalog+0x239>
mov    $0x16,%edi
call   1050 <exportIO@plt>
mov    %eax,-0xc(%rbp)
mov    $0x16,%edi
lea    0xdd8(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x16,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1369 <enableAnalog+0x239>
mov    $0x15,%edi
call   1050 <exportIO@plt>
mov    %eax,-0xc(%rbp)
mov    $0x15,%edi
lea    0xd97(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x15,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1d,%edi
call   1050 <exportIO@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1d,%edi
lea    0xd5e(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1d,%edi
mov    $0x1,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1369 <enableAnalog+0x239>
mov    $0x14,%edi
call   1050 <exportIO@plt>
mov    %eax,-0xc(%rbp)
mov    $0x14,%edi
lea    0xd1a(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x14,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1d,%edi
call   1050 <exportIO@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1d,%edi
lea    0xce1(%rip),%rsi
call   1030 <direction@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1d,%edi
mov    $0x1,%esi
call   1040 <setDigital@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1369 <enableAnalog+0x239>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableAnalog>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x5,%dil
ja     1177 <enableAnalog+0x47>
mov    %edi,%eax
lea    0xebd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x25,%edi
call   1050 <exportIO@plt>
mov    %eax,%ebx
lea    0xeb9(%rip),%rsi
mov    $0x25,%edi
call   1030 <direction@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x25,%edi
jmp    11f7 <enableAnalog+0xc7>
mov    $0xffffffff,%eax
jmp    1294 <enableAnalog+0x164>
mov    $0x24,%edi
call   1050 <exportIO@plt>
mov    %eax,%ebx
lea    0xe84(%rip),%rsi
mov    $0x24,%edi
call   1030 <direction@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x24,%edi
jmp    11f7 <enableAnalog+0xc7>
mov    $0x17,%edi
call   1050 <exportIO@plt>
mov    %eax,%ebx
lea    0xe5c(%rip),%rsi
mov    $0x17,%edi
call   1030 <direction@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x17,%edi
jmp    11f7 <enableAnalog+0xc7>
mov    $0x16,%edi
call   1050 <exportIO@plt>
mov    %eax,%ebx
lea    0xe34(%rip),%rsi
mov    $0x16,%edi
call   1030 <direction@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x16,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
add    %ebp,%eax
jmp    1294 <enableAnalog+0x164>
mov    $0x15,%edi
call   1050 <exportIO@plt>
mov    %eax,%ebx
lea    0xe00(%rip),%r14
mov    $0x15,%edi
mov    %r14,%rsi
call   1030 <direction@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x15,%edi
jmp    1259 <enableAnalog+0x129>
mov    $0x14,%edi
call   1050 <exportIO@plt>
mov    %eax,%ebx
lea    0xdd5(%rip),%r14
mov    $0x14,%edi
mov    %r14,%rsi
call   1030 <direction@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x14,%edi
xor    %esi,%esi
call   1040 <setDigital@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x1d,%edi
call   1050 <exportIO@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x1d,%edi
mov    %r14,%rsi
call   1030 <direction@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x1d,%edi
mov    $0x1,%esi
call   1040 <setDigital@plt>
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"out\00"
define i32 @enableAnalog(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
switch i32 %6, label %79 [
i32 0, label %7
i32 1, label %16
i32 2, label %25
i32 3, label %34
i32 4, label %43
i32 5, label %61
]
7: ; preds = %1
%8 = call i32 @exportIO(i32 37)
store i32 %8, i32* %4
%9 = call i32 @direction(i32 37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = add nsw i32 %10, %9
store i32 %11, i32* %4
%12 = call i32 @setDigital(i32 37, i32 0)
%13 = load i32, i32* %4
%14 = add nsw i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %80
16: ; preds = %1
%17 = call i32 @exportIO(i32 36)
store i32 %17, i32* %4
%18 = call i32 @direction(i32 36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* %4
%20 = add nsw i32 %19, %18
store i32 %20, i32* %4
%21 = call i32 @setDigital(i32 36, i32 0)
%22 = load i32, i32* %4
%23 = add nsw i32 %22, %21
store i32 %23, i32* %4
%24 = load i32, i32* %4
store i32 %24, i32* %2
br label %80
25: ; preds = %1
%26 = call i32 @exportIO(i32 23)
store i32 %26, i32* %4
%27 = call i32 @direction(i32 23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = add nsw i32 %28, %27
store i32 %29, i32* %4
%30 = call i32 @setDigital(i32 23, i32 0)
%31 = load i32, i32* %4
%32 = add nsw i32 %31, %30
store i32 %32, i32* %4
%33 = load i32, i32* %4
store i32 %33, i32* %2
br label %80
34: ; preds = %1
%35 = call i32 @exportIO(i32 22)
store i32 %35, i32* %4
%36 = call i32 @direction(i32 22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%37 = load i32, i32* %4
%38 = add nsw i32 %37, %36
store i32 %38, i32* %4
%39 = call i32 @setDigital(i32 22, i32 0)
%40 = load i32, i32* %4
%41 = add nsw i32 %40, %39
store i32 %41, i32* %4
%42 = load i32, i32* %4
store i32 %42, i32* %2
br label %80
43: ; preds = %1
%44 = call i32 @exportIO(i32 21)
store i32 %44, i32* %4
%45 = call i32 @direction(i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%46 = load i32, i32* %4
%47 = add nsw i32 %46, %45
store i32 %47, i32* %4
%48 = call i32 @setDigital(i32 21, i32 0)
%49 = load i32, i32* %4
%50 = add nsw i32 %49, %48
store i32 %50, i32* %4
%51 = call i32 @exportIO(i32 29)
%52 = load i32, i32* %4
%53 = add nsw i32 %52, %51
store i32 %53, i32* %4
%54 = call i32 @direction(i32 29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%55 = load i32, i32* %4
%56 = add nsw i32 %55, %54
store i32 %56, i32* %4
%57 = call i32 @setDigital(i32 29, i32 1)
%58 = load i32, i32* %4
%59 = add nsw i32 %58, %57
store i32 %59, i32* %4
%60 = load i32, i32* %4
store i32 %60, i32* %2
br label %80
61: ; preds = %1
%62 = call i32 @exportIO(i32 20)
store i32 %62, i32* %4
%63 = call i32 @direction(i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%64 = load i32, i32* %4
%65 = add nsw i32 %64, %63
store i32 %65, i32* %4
%66 = call i32 @setDigital(i32 20, i32 0)
%67 = load i32, i32* %4
%68 = add nsw i32 %67, %66
store i32 %68, i32* %4
%69 = call i32 @exportIO(i32 29)
%70 = load i32, i32* %4
%71 = add nsw i32 %70, %69
store i32 %71, i32* %4
%72 = call i32 @direction(i32 29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%73 = load i32, i32* %4
%74 = add nsw i32 %73, %72
store i32 %74, i32* %4
%75 = call i32 @setDigital(i32 29, i32 1)
%76 = load i32, i32* %4
%77 = add nsw i32 %76, %75
store i32 %77, i32* %4
%78 = load i32, i32* %4
store i32 %78, i32* %2
br label %80
79: ; preds = %1
store i32 -1, i32* %2
br label %80
80: ; preds = %79, %61, %43, %34, %25, %16, %7
%81 = load i32, i32* %2
ret i32 %81
}

LLVM IR (-O2):
@.str = [4 x i8] c"out\00"
define i32 @enableAnalog(i8 zeroext %0) {
switch i8 %0, label %50 [
i8 0, label %2
i8 1, label %8
i8 2, label %14
i8 3, label %20
i8 4, label %26
i8 5, label %38
]
2: ; preds = %1
%3 = tail call i32 @exportIO(i32 37)
%4 = tail call i32 @direction(i32 37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = add nsw i32 %4, %3
%6 = tail call i32 @setDigital(i32 37, i32 0)
%7 = add nsw i32 %5, %6
br label %50
8: ; preds = %1
%9 = tail call i32 @exportIO(i32 36)
%10 = tail call i32 @direction(i32 36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = add nsw i32 %10, %9
%12 = tail call i32 @setDigital(i32 36, i32 0)
%13 = add nsw i32 %11, %12
br label %50
14: ; preds = %1
%15 = tail call i32 @exportIO(i32 23)
%16 = tail call i32 @direction(i32 23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = add nsw i32 %16, %15
%18 = tail call i32 @setDigital(i32 23, i32 0)
%19 = add nsw i32 %17, %18
br label %50
20: ; preds = %1
%21 = tail call i32 @exportIO(i32 22)
%22 = tail call i32 @direction(i32 22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%23 = add nsw i32 %22, %21
%24 = tail call i32 @setDigital(i32 22, i32 0)
%25 = add nsw i32 %23, %24
br label %50
26: ; preds = %1
%27 = tail call i32 @exportIO(i32 21)
%28 = tail call i32 @direction(i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%29 = add nsw i32 %28, %27
%30 = tail call i32 @setDigital(i32 21, i32 0)
%31 = add nsw i32 %29, %30
%32 = tail call i32 @exportIO(i32 29)
%33 = add nsw i32 %31, %32
%34 = tail call i32 @direction(i32 29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%35 = add nsw i32 %33, %34
%36 = tail call i32 @setDigital(i32 29, i32 1)
%37 = add nsw i32 %35, %36
br label %50
38: ; preds = %1
%39 = tail call i32 @exportIO(i32 20)
%40 = tail call i32 @direction(i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%41 = add nsw i32 %40, %39
%42 = tail call i32 @setDigital(i32 20, i32 0)
%43 = add nsw i32 %41, %42
%44 = tail call i32 @exportIO(i32 29)
%45 = add nsw i32 %43, %44
%46 = tail call i32 @direction(i32 29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%47 = add nsw i32 %45, %46
%48 = tail call i32 @setDigital(i32 29, i32 1)
%49 = add nsw i32 %47, %48
br label %50
50: ; preds = %1, %38, %26, %20, %14, %8, %2
%51 = phi i32 [ %49, %38 ], [ %37, %26 ], [ %25, %20 ], [ %19, %14 ], [ %13, %8 ], [ %7, %2 ], [ -1, %1 ]
ret i32 %51
}