#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*/ GPIO_SetIndex(int, int);
void Moto_AB1(char a, char b) {
  if (a > 0) {
    GPIO_SetIndex(9, 1);
    GPIO_SetIndex(11, 0);
  } else if (a < 0) {
    GPIO_SetIndex(9, 1);
    GPIO_SetIndex(11, 1);
  } else {
    GPIO_SetIndex(9, 0);
    GPIO_SetIndex(11, 0);
  }
  if (b > 0) {
    GPIO_SetIndex(8, 1);
    GPIO_SetIndex(10, 1);
  } else if (b < 0) {
    GPIO_SetIndex(8, 1);
    GPIO_SetIndex(10, 0);
  } else {
    GPIO_SetIndex(8, 0);
    GPIO_SetIndex(10, 1);
  }
}


x86 assembly (clang, -O0):
<Moto_AB1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    1151 <Moto_AB1+0x41>
mov    $0x9,%edi
mov    $0x1,%esi
call   1030 <GPIO_SetIndex@plt>
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <GPIO_SetIndex@plt>
jmp    119e <Moto_AB1+0x8e>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jge    1181 <Moto_AB1+0x71>
mov    $0x9,%edi
mov    $0x1,%esi
call   1030 <GPIO_SetIndex@plt>
mov    $0xb,%edi
mov    $0x1,%esi
call   1030 <GPIO_SetIndex@plt>
jmp    1199 <Moto_AB1+0x89>
mov    $0x9,%edi
xor    %esi,%esi
call   1030 <GPIO_SetIndex@plt>
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <GPIO_SetIndex@plt>
jmp    119e <Moto_AB1+0x8e>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jle    11ce <Moto_AB1+0xbe>
mov    $0x8,%edi
mov    $0x1,%esi
call   1030 <GPIO_SetIndex@plt>
mov    $0xa,%edi
mov    $0x1,%esi
call   1030 <GPIO_SetIndex@plt>
jmp    121b <Moto_AB1+0x10b>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jge    11fb <Moto_AB1+0xeb>
mov    $0x8,%edi
mov    $0x1,%esi
call   1030 <GPIO_SetIndex@plt>
mov    $0xa,%edi
xor    %esi,%esi
call   1030 <GPIO_SetIndex@plt>
jmp    1216 <Moto_AB1+0x106>
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <GPIO_SetIndex@plt>
mov    $0xa,%edi
mov    $0x1,%esi
call   1030 <GPIO_SetIndex@plt>
jmp    121b <Moto_AB1+0x10b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Moto_AB1>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
shr    $0x7,%al
xor    %ebp,%ebp
test   %dil,%dil
movzbl %al,%esi
mov    $0x1,%r14d
cmovle %esi,%ebp
cmovg  %r14d,%esi
mov    $0x9,%edi
call   1030 <GPIO_SetIndex@plt>
mov    $0xb,%edi
mov    %ebp,%esi
call   1030 <GPIO_SetIndex@plt>
mov    %ebx,%eax
shr    $0x7,%al
mov    %ebx,%ecx
not    %cl
shr    $0x7,%cl
test   %bl,%bl
movzbl %al,%eax
cmovg  %r14d,%eax
movzbl %al,%esi
movzbl %cl,%eax
cmovg  %r14d,%eax
movzbl %al,%ebx
mov    $0x8,%edi
call   1030 <GPIO_SetIndex@plt>
mov    $0xa,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <GPIO_SetIndex@plt>

LLVM IR (-O0):
define void @Moto_AB1(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @GPIO_SetIndex(i32 9, i32 1)
%10 = call i32 @GPIO_SetIndex(i32 11, i32 0)
br label %22
11: ; preds = %2
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 @GPIO_SetIndex(i32 9, i32 1)
%17 = call i32 @GPIO_SetIndex(i32 11, i32 1)
br label %21
18: ; preds = %11
%19 = call i32 @GPIO_SetIndex(i32 9, i32 0)
%20 = call i32 @GPIO_SetIndex(i32 11, i32 0)
br label %21
21: ; preds = %18, %15
br label %22
22: ; preds = %21, %8
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = call i32 @GPIO_SetIndex(i32 8, i32 1)
%28 = call i32 @GPIO_SetIndex(i32 10, i32 1)
br label %40
29: ; preds = %22
%30 = load i8, i8* %4
%31 = sext i8 %30 to i32
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = call i32 @GPIO_SetIndex(i32 8, i32 1)
%35 = call i32 @GPIO_SetIndex(i32 10, i32 0)
br label %39
36: ; preds = %29
%37 = call i32 @GPIO_SetIndex(i32 8, i32 0)
%38 = call i32 @GPIO_SetIndex(i32 10, i32 1)
br label %39
39: ; preds = %36, %33
br label %40
40: ; preds = %39, %26
ret void
}

LLVM IR (-O2):
define void @Moto_AB1(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 0
%4 = lshr i8 %0, 7
%5 = zext i8 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
%7 = select i1 %3, i32 0, i32 %5
%8 = tail call i32 @GPIO_SetIndex(i32 9, i32 %6)
%9 = tail call i32 @GPIO_SetIndex(i32 11, i32 %7)
%10 = icmp sgt i8 %1, 0
%11 = lshr i8 %1, 7
%12 = xor i8 %1, -1
%13 = lshr i8 %12, 7
%14 = select i1 %10, i8 1, i8 %11
%15 = zext i8 %14 to i32
%16 = select i1 %10, i8 1, i8 %13
%17 = zext i8 %16 to i32
%18 = tail call i32 @GPIO_SetIndex(i32 8, i32 %15)
%19 = tail call i32 @GPIO_SetIndex(i32 10, i32 %17)
ret void
}