#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*/ sector_error(int);
void *row_selector(int *row_begin, int *row_final, int sector) {
  if (sector == 1) {
    (*row_begin) = 0;
    (*row_final) = 3;
  } else if (sector == 2) {
    (*row_begin) = 0;
    (*row_final) = 3;
  } else if (sector == 3) {
    (*row_begin) = 0;
    (*row_final) = 3;
  } else if (sector == 4) {
    (*row_begin) = 3;
    (*row_final) = 6;
  } else if (sector == 5) {
    (*row_begin) = 3;
    (*row_final) = 6;
  } else if (sector == 6) {
    (*row_begin) = 3;
    (*row_final) = 6;
  } else if (sector == 7) {
    (*row_begin) = 6;
    (*row_final) = 9;
  } else if (sector == 8) {
    (*row_begin) = 6;
    (*row_final) = 9;
  } else if (sector == 9) {
    (*row_begin) = 6;
    (*row_final) = 9;
  } else {
    sector_error(true);
  }
}


x86 assembly (clang, -O0):
<row_selector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1146 <row_selector+0x36>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
jmp    1290 <row_selector+0x180>
cmpl   $0x2,-0x1c(%rbp)
jne    1169 <row_selector+0x59>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
jmp    128b <row_selector+0x17b>
cmpl   $0x3,-0x1c(%rbp)
jne    118c <row_selector+0x7c>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
jmp    1286 <row_selector+0x176>
cmpl   $0x4,-0x1c(%rbp)
jne    11af <row_selector+0x9f>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
jmp    1281 <row_selector+0x171>
cmpl   $0x5,-0x1c(%rbp)
jne    11d2 <row_selector+0xc2>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
jmp    127c <row_selector+0x16c>
cmpl   $0x6,-0x1c(%rbp)
jne    11f5 <row_selector+0xe5>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
jmp    1277 <row_selector+0x167>
cmpl   $0x7,-0x1c(%rbp)
jne    1218 <row_selector+0x108>
mov    -0x10(%rbp),%rax
movl   $0x6,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
jmp    1272 <row_selector+0x162>
cmpl   $0x8,-0x1c(%rbp)
jne    123b <row_selector+0x12b>
mov    -0x10(%rbp),%rax
movl   $0x6,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
jmp    126d <row_selector+0x15d>
cmpl   $0x9,-0x1c(%rbp)
jne    125e <row_selector+0x14e>
mov    -0x10(%rbp),%rax
movl   $0x6,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
jmp    1268 <row_selector+0x158>
mov    $0x1,%edi
call   1030 <sector_error@plt>
jmp    126d <row_selector+0x15d>
jmp    1272 <row_selector+0x162>
jmp    1277 <row_selector+0x167>
jmp    127c <row_selector+0x16c>
jmp    1281 <row_selector+0x171>
jmp    1286 <row_selector+0x176>
jmp    128b <row_selector+0x17b>
jmp    1290 <row_selector+0x180>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_selector>:
push   %rax
add    $0xffffffff,%edx
cmp    $0x8,%edx
ja     1153 <row_selector+0x43>
lea    0xee0(%rip),%rax
movslq (%rax,%rdx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movl   $0x0,(%rdi)
movl   $0x3,(%rsi)
pop    %rcx
ret
movl   $0x3,(%rdi)
movl   $0x6,(%rsi)
pop    %rcx
ret
movl   $0x6,(%rdi)
movl   $0x9,(%rsi)
pop    %rcx
ret
mov    $0x1,%edi
call   1030 <sector_error@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @row_selector(i32* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32*, i32** %5
store i32 0, i32* %11
%12 = load i32*, i32** %6
store i32 3, i32* %12
br label %71
13: ; preds = %3
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32*, i32** %5
store i32 0, i32* %17
%18 = load i32*, i32** %6
store i32 3, i32* %18
br label %70
19: ; preds = %13
%20 = load i32, i32* %7
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32*, i32** %5
store i32 0, i32* %23
%24 = load i32*, i32** %6
store i32 3, i32* %24
br label %69
25: ; preds = %19
%26 = load i32, i32* %7
%27 = icmp eq i32 %26, 4
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32*, i32** %5
store i32 3, i32* %29
%30 = load i32*, i32** %6
store i32 6, i32* %30
br label %68
31: ; preds = %25
%32 = load i32, i32* %7
%33 = icmp eq i32 %32, 5
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32*, i32** %5
store i32 3, i32* %35
%36 = load i32*, i32** %6
store i32 6, i32* %36
br label %67
37: ; preds = %31
%38 = load i32, i32* %7
%39 = icmp eq i32 %38, 6
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i32*, i32** %5
store i32 3, i32* %41
%42 = load i32*, i32** %6
store i32 6, i32* %42
br label %66
43: ; preds = %37
%44 = load i32, i32* %7
%45 = icmp eq i32 %44, 7
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i32*, i32** %5
store i32 6, i32* %47
%48 = load i32*, i32** %6
store i32 9, i32* %48
br label %65
49: ; preds = %43
%50 = load i32, i32* %7
%51 = icmp eq i32 %50, 8
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32*, i32** %5
store i32 6, i32* %53
%54 = load i32*, i32** %6
store i32 9, i32* %54
br label %64
55: ; preds = %49
%56 = load i32, i32* %7
%57 = icmp eq i32 %56, 9
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32*, i32** %5
store i32 6, i32* %59
%60 = load i32*, i32** %6
store i32 9, i32* %60
br label %63
61: ; preds = %55
%62 = call i32 @sector_error(i32 1)
br label %63
63: ; preds = %61, %58
br label %64
64: ; preds = %63, %52
br label %65
65: ; preds = %64, %46
br label %66
66: ; preds = %65, %40
br label %67
67: ; preds = %66, %34
br label %68
68: ; preds = %67, %28
br label %69
69: ; preds = %68, %22
br label %70
70: ; preds = %69, %16
br label %71
71: ; preds = %70, %10
%72 = load i8*, i8** %4
ret i8* %72
}

LLVM IR (-O2):
define noalias i8* @row_selector(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2) {
switch i32 %2, label %13 [
i32 1, label %4
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %8
i32 6, label %9
i32 7, label %10
i32 8, label %11
i32 9, label %12
]
4: ; preds = %3
store i32 0, i32* %0
store i32 3, i32* %1
br label %15
5: ; preds = %3
store i32 0, i32* %0
store i32 3, i32* %1
br label %15
6: ; preds = %3
store i32 0, i32* %0
store i32 3, i32* %1
br label %15
7: ; preds = %3
store i32 3, i32* %0
store i32 6, i32* %1
br label %15
8: ; preds = %3
store i32 3, i32* %0
store i32 6, i32* %1
br label %15
9: ; preds = %3
store i32 3, i32* %0
store i32 6, i32* %1
br label %15
10: ; preds = %3
store i32 6, i32* %0
store i32 9, i32* %1
br label %15
11: ; preds = %3
store i32 6, i32* %0
store i32 9, i32* %1
br label %15
12: ; preds = %3
store i32 6, i32* %0
store i32 9, i32* %1
br label %15
13: ; preds = %3
%14 = tail call i32 @sector_error(i32 1)
br label %15
15: ; preds = %5, %7, %9, %11, %13, %12, %10, %8, %6, %4
ret i8* undef
}