#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_pullup(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);
  (*((volatile uint32_t *)((gpio_mux_reg)))) =
      (uint32_t)(((*((volatile uint32_t *)(gpio_mux_reg))) | (0x00000080)));
}


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

x86 assembly (clang, -O2):
<gpio_pad_pullup>:
cmp    $0xe,%edi
ja     1128 <gpio_pad_pullup+0x28>
mov    $0x60000834,%eax
mov    %edi,%ecx
lea    0xeed(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x60000818,%eax
orl    $0x80,(%rax)
ret
cmp    $0xf,%edi
mov    $0x60000810,%ecx
mov    $0x600007a0,%eax
cmove  %rcx,%rax
orl    $0x80,(%rax)
ret
mov    $0x60000838,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000814,%eax
orl    $0x80,(%rax)
ret
mov    $0x6000083c,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000840,%eax
orl    $0x80,(%rax)
ret
mov    $0x6000081c,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000820,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000824,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000828,%eax
orl    $0x80,(%rax)
ret
mov    $0x6000082c,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000830,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000804,%eax
orl    $0x80,(%rax)
ret
mov    $0x60000808,%eax
orl    $0x80,(%rax)
ret
mov    $0x6000080c,%eax
orl    $0x80,(%rax)
ret

LLVM IR (-O0):
define void @gpio_pad_pullup(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* %3
%99 = sext i32 %98 to i64
%100 = inttoptr i64 %99 to i32*
%101 = load volatile i32, i32* %100
%102 = or i32 %101, 128
%103 = load i32, i32* %3
%104 = sext i32 %103 to i64
%105 = inttoptr i64 %104 to i32*
store volatile i32 %102, i32* %105
ret void
}

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