#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 */
typedef int uint32_t;

/* Variables and functions */
void gpio_pad_select_gpio(uint32_t gpio_num) {
  uint32_t gpio_mux_reg = (gpio_num == 0)    ? (0x60000800 + 0x34)
                          : (gpio_num == 1)  ? (0x60000800 + 0x18)
                          : (gpio_num == 2)  ? (0x60000800 + 0x38)
                          : (gpio_num == 3)  ? (0x60000800 + 0x14)
                          : (gpio_num == 4)  ? (0x60000800 + 0x3C)
                          : (gpio_num == 5)  ? (0x60000800 + 0x40)
                          : (gpio_num == 6)  ? (0x60000800 + 0x1c)
                          : (gpio_num == 7)  ? (0x60000800 + 0x20)
                          : (gpio_num == 8)  ? (0x60000800 + 0x24)
                          : (gpio_num == 9)  ? (0x60000800 + 0x28)
                          : (gpio_num == 10) ? (0x60000800 + 0x2c)
                          : (gpio_num == 11) ? (0x60000800 + 0x30)
                          : (gpio_num == 12) ? (0x60000800 + 0x04)
                          : (gpio_num == 13) ? (0x60000800 + 0x08)
                          : (gpio_num == 14) ? (0x60000800 + 0x0C)
                          : (gpio_num == 15) ? (0x60000800 + 0x10)
                                             : (0x60000700 + 0x0A0);
  if (gpio_num == 0 || gpio_num == 2 || gpio_num == 4 || gpio_num == 5) {
    do {
      (*((volatile uint32_t *)((gpio_mux_reg)))) = (uint32_t)((
          (*((volatile uint32_t *)(gpio_mux_reg))) & (~((0x13 << 4)))));
      (*((volatile uint32_t *)((gpio_mux_reg)))) =
          (uint32_t)(((*((volatile uint32_t *)(gpio_mux_reg))) |
                      ((((0 & 0x00000004) << 2) | (0 & 0x3)) << 4)));
    } while (0);
  } else {
    do {
      (*((volatile uint32_t *)((gpio_mux_reg)))) = (uint32_t)((
          (*((volatile uint32_t *)(gpio_mux_reg))) & (~((0x13 << 4)))));
      (*((volatile uint32_t *)((gpio_mux_reg)))) =
          (uint32_t)(((*((volatile uint32_t *)(gpio_mux_reg))) |
                      ((((3 & 0x00000004) << 2) | (3 & 0x3)) << 4)));
    } while (0);
  }
}


x86 assembly (clang, -O0):
<gpio_pad_select_gpio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111e <gpio_pad_select_gpio+0x1e>
mov    $0x60000834,%eax
mov    %eax,-0xc(%rbp)
jmp    12ca <gpio_pad_select_gpio+0x1ca>
cmpl   $0x1,-0x4(%rbp)
jne    1135 <gpio_pad_select_gpio+0x35>
mov    $0x60000818,%eax
mov    %eax,-0x10(%rbp)
jmp    12c4 <gpio_pad_select_gpio+0x1c4>
cmpl   $0x2,-0x4(%rbp)
jne    114c <gpio_pad_select_gpio+0x4c>
mov    $0x60000838,%eax
mov    %eax,-0x14(%rbp)
jmp    12be <gpio_pad_select_gpio+0x1be>
cmpl   $0x3,-0x4(%rbp)
jne    1163 <gpio_pad_select_gpio+0x63>
mov    $0x60000814,%eax
mov    %eax,-0x18(%rbp)
jmp    12b8 <gpio_pad_select_gpio+0x1b8>
cmpl   $0x4,-0x4(%rbp)
jne    117a <gpio_pad_select_gpio+0x7a>
mov    $0x6000083c,%eax
mov    %eax,-0x1c(%rbp)
jmp    12b2 <gpio_pad_select_gpio+0x1b2>
cmpl   $0x5,-0x4(%rbp)
jne    1191 <gpio_pad_select_gpio+0x91>
mov    $0x60000840,%eax
mov    %eax,-0x20(%rbp)
jmp    12ac <gpio_pad_select_gpio+0x1ac>
cmpl   $0x6,-0x4(%rbp)
jne    11a8 <gpio_pad_select_gpio+0xa8>
mov    $0x6000081c,%eax
mov    %eax,-0x24(%rbp)
jmp    12a6 <gpio_pad_select_gpio+0x1a6>
cmpl   $0x7,-0x4(%rbp)
jne    11bf <gpio_pad_select_gpio+0xbf>
mov    $0x60000820,%eax
mov    %eax,-0x28(%rbp)
jmp    12a0 <gpio_pad_select_gpio+0x1a0>
cmpl   $0x8,-0x4(%rbp)
jne    11d6 <gpio_pad_select_gpio+0xd6>
mov    $0x60000824,%eax
mov    %eax,-0x2c(%rbp)
jmp    129a <gpio_pad_select_gpio+0x19a>
cmpl   $0x9,-0x4(%rbp)
jne    11ed <gpio_pad_select_gpio+0xed>
mov    $0x60000828,%eax
mov    %eax,-0x30(%rbp)
jmp    1294 <gpio_pad_select_gpio+0x194>
cmpl   $0xa,-0x4(%rbp)
jne    1204 <gpio_pad_select_gpio+0x104>
mov    $0x6000082c,%eax
mov    %eax,-0x34(%rbp)
jmp    128e <gpio_pad_select_gpio+0x18e>
cmpl   $0xb,-0x4(%rbp)
jne    121b <gpio_pad_select_gpio+0x11b>
mov    $0x60000830,%eax
mov    %eax,-0x38(%rbp)
jmp    1288 <gpio_pad_select_gpio+0x188>
cmpl   $0xc,-0x4(%rbp)
jne    1232 <gpio_pad_select_gpio+0x132>
mov    $0x60000804,%eax
mov    %eax,-0x3c(%rbp)
jmp    1282 <gpio_pad_select_gpio+0x182>
cmpl   $0xd,-0x4(%rbp)
jne    1249 <gpio_pad_select_gpio+0x149>
mov    $0x60000808,%eax
mov    %eax,-0x40(%rbp)
jmp    127c <gpio_pad_select_gpio+0x17c>
cmpl   $0xe,-0x4(%rbp)
jne    1260 <gpio_pad_select_gpio+0x160>
mov    $0x6000080c,%eax
mov    %eax,-0x44(%rbp)
jmp    1276 <gpio_pad_select_gpio+0x176>
mov    -0x4(%rbp),%edx
mov    $0x600007a0,%eax
mov    $0x60000810,%ecx
cmp    $0xf,%edx
cmove  %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     12f8 <gpio_pad_select_gpio+0x1f8>
cmpl   $0x2,-0x4(%rbp)
je     12f8 <gpio_pad_select_gpio+0x1f8>
cmpl   $0x4,-0x4(%rbp)
je     12f8 <gpio_pad_select_gpio+0x1f8>
cmpl   $0x5,-0x4(%rbp)
jne    1323 <gpio_pad_select_gpio+0x223>
jmp    12fd <gpio_pad_select_gpio+0x1fd>
movslq -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xfffffecf,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,(%rax)
movslq -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x0,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    134e <gpio_pad_select_gpio+0x24e>
jmp    1328 <gpio_pad_select_gpio+0x228>
movslq -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xfffffecf,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,(%rax)
movslq -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x30,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    134e <gpio_pad_select_gpio+0x24e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_pad_select_gpio>:
cmp    $0xe,%edi
ja     1128 <gpio_pad_select_gpio+0x28>
mov    $0x60000818,%eax
mov    $0x60000834,%ecx
mov    %edi,%edx
lea    0xee8(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0x60000838,%ecx
jmp    114e <gpio_pad_select_gpio+0x4e>
cmp    $0xf,%edi
mov    $0x60000810,%ecx
mov    $0x600007a0,%eax
cmove  %rcx,%rax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x60000814,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x6000083c,%ecx
jmp    114e <gpio_pad_select_gpio+0x4e>
mov    $0x60000840,%ecx
andl   $0xfffffecf,(%rcx)
mov    (%rcx),%eax
mov    %eax,(%rcx)
ret
mov    $0x6000081c,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x60000820,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x60000824,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x60000828,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x6000082c,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x60000830,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x60000804,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x60000808,%eax
jmp    1196 <gpio_pad_select_gpio+0x96>
mov    $0x6000080c,%eax
andl   $0xfffffecf,(%rax)
orl    $0x30,(%rax)
ret

LLVM IR (-O0):
define void @gpio_pad_select_gpio(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %96
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
br label %94
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %11
br label %92
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15
br label %90
19: ; preds = %15
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %19
br label %88
23: ; preds = %19
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %27
26: ; preds = %23
br label %86
27: ; preds = %23
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 6
br i1 %29, label %30, label %31
30: ; preds = %27
br label %84
31: ; preds = %27
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 7
br i1 %33, label %34, label %35
34: ; preds = %31
br label %82
35: ; preds = %31
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 8
br i1 %37, label %38, label %39
38: ; preds = %35
br label %80
39: ; preds = %35
%40 = load i32, i32* %2
%41 = icmp eq i32 %40, 9
br i1 %41, label %42, label %43
42: ; preds = %39
br label %78
43: ; preds = %39
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 10
br i1 %45, label %46, label %47
46: ; preds = %43
br label %76
47: ; preds = %43
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 11
br i1 %49, label %50, label %51
50: ; preds = %47
br label %74
51: ; preds = %47
%52 = load i32, i32* %2
%53 = icmp eq i32 %52, 12
br i1 %53, label %54, label %55
54: ; preds = %51
br label %72
55: ; preds = %51
%56 = load i32, i32* %2
%57 = icmp eq i32 %56, 13
br i1 %57, label %58, label %59
58: ; preds = %55
br label %70
59: ; preds = %55
%60 = load i32, i32* %2
%61 = icmp eq i32 %60, 14
br i1 %61, label %62, label %63
62: ; preds = %59
br label %68
63: ; preds = %59
%64 = load i32, i32* %2
%65 = icmp eq i32 %64, 15
%66 = zext i1 %65 to i64
%67 = select i1 %65, i32 1610614800, i32 1610614688
br label %68
68: ; preds = %63, %62
%69 = phi i32 [ 1610614796, %62 ], [ %67, %63 ]
br label %70
70: ; preds = %68, %58
%71 = phi i32 [ 1610614792, %58 ], [ %69, %68 ]
br label %72
72: ; preds = %70, %54
%73 = phi i32 [ 1610614788, %54 ], [ %71, %70 ]
br label %74
74: ; preds = %72, %50
%75 = phi i32 [ 1610614832, %50 ], [ %73, %72 ]
br label %76
76: ; preds = %74, %46
%77 = phi i32 [ 1610614828, %46 ], [ %75, %74 ]
br label %78
78: ; preds = %76, %42
%79 = phi i32 [ 1610614824, %42 ], [ %77, %76 ]
br label %80
80: ; preds = %78, %38
%81 = phi i32 [ 1610614820, %38 ], [ %79, %78 ]
br label %82
82: ; preds = %80, %34
%83 = phi i32 [ 1610614816, %34 ], [ %81, %80 ]
br label %84
84: ; preds = %82, %30
%85 = phi i32 [ 1610614812, %30 ], [ %83, %82 ]
br label %86
86: ; preds = %84, %26
%87 = phi i32 [ 1610614848, %26 ], [ %85, %84 ]
br label %88
88: ; preds = %86, %22
%89 = phi i32 [ 1610614844, %22 ], [ %87, %86 ]
br label %90
90: ; preds = %88, %18
%91 = phi i32 [ 1610614804, %18 ], [ %89, %88 ]
br label %92
92: ; preds = %90, %14
%93 = phi i32 [ 1610614840, %14 ], [ %91, %90 ]
br label %94
94: ; preds = %92, %10
%95 = phi i32 [ 1610614808, %10 ], [ %93, %92 ]
br label %96
96: ; preds = %94, %6
%97 = phi i32 [ 1610614836, %6 ], [ %95, %94 ]
store i32 %97, i32* %3
%98 = load i32, i32* %2
%99 = icmp eq i32 %98, 0
br i1 %99, label %109, label %100
100: ; preds = %96
%101 = load i32, i32* %2
%102 = icmp eq i32 %101, 2
br i1 %102, label %109, label %103
103: ; preds = %100
%104 = load i32, i32* %2
%105 = icmp eq i32 %104, 4
br i1 %105, label %109, label %106
106: ; preds = %103
%107 = load i32, i32* %2
%108 = icmp eq i32 %107, 5
br i1 %108, label %109, label %128
109: ; preds = %106, %103, %100, %96
br label %110
110: ; preds = %109
%111 = load i32, i32* %3
%112 = sext i32 %111 to i64
%113 = inttoptr i64 %112 to i32*
%114 = load volatile i32, i32* %113
%115 = and i32 %114, -305
%116 = load i32, i32* %3
%117 = sext i32 %116 to i64
%118 = inttoptr i64 %117 to i32*
store volatile i32 %115, i32* %118
%119 = load i32, i32* %3
%120 = sext i32 %119 to i64
%121 = inttoptr i64 %120 to i32*
%122 = load volatile i32, i32* %121
%123 = or i32 %122, 0
%124 = load i32, i32* %3
%125 = sext i32 %124 to i64
%126 = inttoptr i64 %125 to i32*
store volatile i32 %123, i32* %126
br label %127
127: ; preds = %110
br label %147
128: ; preds = %106
br label %129
129: ; preds = %128
%130 = load i32, i32* %3
%131 = sext i32 %130 to i64
%132 = inttoptr i64 %131 to i32*
%133 = load volatile i32, i32* %132
%134 = and i32 %133, -305
%135 = load i32, i32* %3
%136 = sext i32 %135 to i64
%137 = inttoptr i64 %136 to i32*
store volatile i32 %134, i32* %137
%138 = load i32, i32* %3
%139 = sext i32 %138 to i64
%140 = inttoptr i64 %139 to i32*
%141 = load volatile i32, i32* %140
%142 = or i32 %141, 48
%143 = load i32, i32* %3
%144 = sext i32 %143 to i64
%145 = inttoptr i64 %144 to i32*
store volatile i32 %142, i32* %145
br label %146
146: ; preds = %129
br label %147
147: ; preds = %146, %127
ret void
}

LLVM IR (-O2):
define void @gpio_pad_select_gpio(i32 %0) {
switch i32 %0, label %15 [
i32 0, label %18
i32 1, label %23
i32 2, label %2
i32 3, label %3
i32 4, label %4
i32 5, label %5
i32 6, label %6
i32 7, label %7
i32 8, label %8
i32 9, label %9
i32 10, label %10
i32 11, label %11
i32 12, label %12
i32 13, label %13
i32 14, label %14
]
2: ; preds = %1
br label %18
3: ; preds = %1
br label %23
4: ; preds = %1
br label %18
5: ; preds = %1
br label %18
6: ; preds = %1
br label %23
7: ; preds = %1
br label %23
8: ; preds = %1
br label %23
9: ; preds = %1
br label %23
10: ; preds = %1
br label %23
11: ; preds = %1
br label %23
12: ; preds = %1
br label %23
13: ; preds = %1
br label %23
14: ; preds = %1
br label %23
15: ; preds = %1
%16 = icmp eq i32 %0, 15
%17 = select i1 %16, i32* inttoptr (i64 1610614800 to i32*), i32* inttoptr (i64 1610614688 to i32*)
br label %23
18: ; preds = %2, %4, %5, %1
%19 = phi i32* [ inttoptr (i64 1610614848 to i32*), %5 ], [ inttoptr (i64 1610614844 to i32*), %4 ], [ inttoptr (i64 1610614840 to i32*), %2 ], [ inttoptr (i64 1610614836 to i32*), %1 ]
%20 = load volatile i32, i32* %19
%21 = and i32 %20, -305
store volatile i32 %21, i32* %19
%22 = load volatile i32, i32* %19
store volatile i32 %22, i32* %19
br label %29
23: ; preds = %15, %1, %3, %6, %7, %8, %9, %10, %11, %12, %13, %14
%24 = phi i32* [ %17, %15 ], [ inttoptr (i64 1610614796 to i32*), %14 ], [ inttoptr (i64 1610614792 to i32*), %13 ], [ inttoptr (i64 1610614788 to i32*), %12 ], [ inttoptr (i64 1610614832 to i32*), %11 ], [ inttoptr (i64 1610614828 to i32*), %10 ], [ inttoptr (i64 1610614824 to i32*), %9 ], [ inttoptr (i64 1610614820 to i32*), %8 ], [ inttoptr (i64 1610614816 to i32*), %7 ], [ inttoptr (i64 1610614812 to i32*), %6 ], [ inttoptr (i64 1610614804 to i32*), %3 ], [ inttoptr (i64 1610614808 to i32*), %1 ]
%25 = load volatile i32, i32* %24
%26 = and i32 %25, -305
store volatile i32 %26, i32* %24
%27 = load volatile i32, i32* %24
%28 = or i32 %27, 48
store volatile i32 %28, i32* %24
br label %29
29: ; preds = %23, %18
ret void
}