#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 errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *, int,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void odroid_xu_pin_lookup(unsigned int pin_index, unsigned int *bank_offset,
                          unsigned int *bit_index) {
  switch (pin_index) {
  case 13:
    *bank_offset = 0x0C20;
    *bit_index = 5;
    break;
  case 14:
    *bank_offset = 0x0C40;
    *bit_index = 3;
    break;
  case 15:
    *bank_offset = 0x0C20;
    *bit_index = 2;
    break;
  case 16:
    *bank_offset = 0x0C20;
    *bit_index = 0;
    break;
  case 17:
    *bank_offset = 0x0C20;
    *bit_index = 6;
    break;
  case 18:
    *bank_offset = 0x0C20;
    *bit_index = 3;
    break;
  case 19:
    *bank_offset = 0x0C40;
    *bit_index = 6;
    break;
  case 20:
    *bank_offset = 0x0C40;
    *bit_index = 4;
    break;
  case 21:
    *bank_offset = 0x0C40;
    *bit_index = 5;
    break;
  case 22:
    *bank_offset = 0x0C40;
    *bit_index = 7;
    break;
  case 23:
    *bank_offset = 0x0C40;
    *bit_index = 2;
    break;
  case 24:
    *bank_offset = 0x0C40;
    *bit_index = 1;
    break;
  case 25:
    *bank_offset = 0x0C20;
    *bit_index = 7;
    break;
  case 26:
    *bank_offset = 0x0C40;
    *bit_index = 0;
    break;
  case 27:
    *bank_offset = 0x0C60;
    *bit_index = 1;
    break;
  default:
    do {
      fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", 146,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/mrj10/exynos_5410_gpio/refs/heads/"
              "master/exynos_5410_gpio.c",
              errno, strerror(errno));
      exit(1);
    } while (0);
    break;
  }
}


x86 assembly (clang, -O0):
<odroid_xu_pin_lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffff3,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xe,%eax
ja     12e3 <odroid_xu_pin_lookup+0x1b3>
mov    -0x20(%rbp),%rax
lea    0xe9d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movl   $0xc20,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc20,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc20,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc20,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc20,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc20,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc40,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
mov    -0x10(%rbp),%rax
movl   $0xc60,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    133a <odroid_xu_pin_lookup+0x20a>
jmp    12e8 <odroid_xu_pin_lookup+0x1b8>
mov    0x2cf1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2cdd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2cd1(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%r8d
mov    %rax,%r9
lea    0xd1d(%rip),%rsi
mov    $0x92,%edx
lea    0xd36(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_pin_lookup>:
push   %rbp
push   %rbx
push   %rax
add    $0xfffffff3,%edi
cmp    $0xf,%edi
jae    115d <odroid_xu_pin_lookup+0x2d>
movslq %edi,%rax
lea    0xf77(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
lea    0xfa9(%rip),%rdi
mov    (%rdi,%rax,4),%eax
mov    %ecx,(%rsi)
mov    %eax,(%rdx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e7c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e6b(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1050 <strerror@plt>
lea    0xe83(%rip),%rsi
lea    0xea1(%rip),%rcx
mov    %ebx,%edi
mov    $0x92,%edx
mov    %ebp,%r8d
mov    %rax,%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Error at line %d, file %s (%d) [%s]\0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mrj10/exynos_5410_gpio/refs/heads/master/exynos_5410_gpio.c\00"
@errno = global i32 0
define void @odroid_xu_pin_lookup(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
switch i32 %7, label %53 [
i32 13, label %8
i32 14, label %11
i32 15, label %14
i32 16, label %17
i32 17, label %20
i32 18, label %23
i32 19, label %26
i32 20, label %29
i32 21, label %32
i32 22, label %35
i32 23, label %38
i32 24, label %41
i32 25, label %44
i32 26, label %47
i32 27, label %50
]
8: ; preds = %3
%9 = load i32*, i32** %5
store i32 3104, i32* %9
%10 = load i32*, i32** %6
store i32 5, i32* %10
br label %62
11: ; preds = %3
%12 = load i32*, i32** %5
store i32 3136, i32* %12
%13 = load i32*, i32** %6
store i32 3, i32* %13
br label %62
14: ; preds = %3
%15 = load i32*, i32** %5
store i32 3104, i32* %15
%16 = load i32*, i32** %6
store i32 2, i32* %16
br label %62
17: ; preds = %3
%18 = load i32*, i32** %5
store i32 3104, i32* %18
%19 = load i32*, i32** %6
store i32 0, i32* %19
br label %62
20: ; preds = %3
%21 = load i32*, i32** %5
store i32 3104, i32* %21
%22 = load i32*, i32** %6
store i32 6, i32* %22
br label %62
23: ; preds = %3
%24 = load i32*, i32** %5
store i32 3104, i32* %24
%25 = load i32*, i32** %6
store i32 3, i32* %25
br label %62
26: ; preds = %3
%27 = load i32*, i32** %5
store i32 3136, i32* %27
%28 = load i32*, i32** %6
store i32 6, i32* %28
br label %62
29: ; preds = %3
%30 = load i32*, i32** %5
store i32 3136, i32* %30
%31 = load i32*, i32** %6
store i32 4, i32* %31
br label %62
32: ; preds = %3
%33 = load i32*, i32** %5
store i32 3136, i32* %33
%34 = load i32*, i32** %6
store i32 5, i32* %34
br label %62
35: ; preds = %3
%36 = load i32*, i32** %5
store i32 3136, i32* %36
%37 = load i32*, i32** %6
store i32 7, i32* %37
br label %62
38: ; preds = %3
%39 = load i32*, i32** %5
store i32 3136, i32* %39
%40 = load i32*, i32** %6
store i32 2, i32* %40
br label %62
41: ; preds = %3
%42 = load i32*, i32** %5
store i32 3136, i32* %42
%43 = load i32*, i32** %6
store i32 1, i32* %43
br label %62
44: ; preds = %3
%45 = load i32*, i32** %5
store i32 3104, i32* %45
%46 = load i32*, i32** %6
store i32 7, i32* %46
br label %62
47: ; preds = %3
%48 = load i32*, i32** %5
store i32 3136, i32* %48
%49 = load i32*, i32** %6
store i32 0, i32* %49
br label %62
50: ; preds = %3
%51 = load i32*, i32** %5
store i32 3168, i32* %51
%52 = load i32*, i32** %6
store i32 1, i32* %52
br label %62
53: ; preds = %3
br label %54
54: ; preds = %53
%55 = load i32, i32* @stderr
%56 = load i32, i32* @errno
%57 = load i32, i32* @errno
%58 = call i8* @strerror(i32 %57)
%59 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 146, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 %56, i8* %58)
%60 = call i32 @exit(i32 1)
unreachable
61: ; No predecessors!
br label %62
62: ; preds = %61, %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Error at line %d, file %s (%d) [%s]\0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mrj10/exynos_5410_gpio/refs/heads/master/exynos_5410_gpio.c\00"
@errno = global i32 0
@switch.table.odroid_xu_pin_lookup = [15 x i32] [i32 3104, i32 3136, i32 3104, i32 3104, i32 3104, i32 3104, i32 3136, i32 3136, i32 3136, i32 3136, i32 3136, i32 3136, i32 3104, i32 3136, i32 3168]
@switch.table.odroid_xu_pin_lookup.2 = [15 x i32] [i32 5, i32 3, i32 2, i32 0, i32 6, i32 3, i32 6, i32 4, i32 5, i32 7, i32 2, i32 1, i32 7, i32 0, i32 1]
define void @odroid_xu_pin_lookup(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = add i32 %0, -13
%5 = icmp ult i32 %4, 15
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 146, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* %9)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %3
%13 = sext i32 %4 to i64
%14 = getelementptr inbounds [15 x i32], [15 x i32]* @switch.table.odroid_xu_pin_lookup, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = sext i32 %4 to i64
%17 = getelementptr inbounds [15 x i32], [15 x i32]* @switch.table.odroid_xu_pin_lookup.2, i64 0, i64 %16
%18 = load i32, i32* %17
store i32 %15, i32* %1
store i32 %18, i32* %2
ret void
}