#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 gpioLedSet(int, int, int, int, int, int);
int ledWps(int gpio, int mode) {
  switch (mode) {
  case 1:
    return gpioLedSet(gpio, 0, 4000, 1, 1, 4000);
    break;
  case 2:
    return gpioLedSet(gpio, 2, 1, 4000, 1, 4000);
    break;
  case 3:
    return gpioLedSet(gpio, 1, 1, 4000, 1, 4000);
    break;
  case 4:
    return gpioLedSet(gpio, 1, 1, 10, 5, 4000);
    break;
  case 5:
    gpioLedSet(gpio, 3000, 1, 1, 1, 1);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ledWps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11fb <ledWps+0xeb>
mov    -0x18(%rbp),%rax
lea    0xec2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0xfa0,%r9d
mov    $0x1,%r8d
mov    %r9d,%edx
mov    %r8d,%ecx
call   1030 <gpioLedSet@plt>
mov    %eax,-0x4(%rbp)
jmp    1202 <ledWps+0xf2>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
mov    $0x1,%r8d
mov    $0xfa0,%r9d
mov    %r8d,%edx
mov    %r9d,%ecx
call   1030 <gpioLedSet@plt>
mov    %eax,-0x4(%rbp)
jmp    1202 <ledWps+0xf2>
mov    -0x8(%rbp),%edi
mov    $0x1,%r8d
mov    $0xfa0,%r9d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
call   1030 <gpioLedSet@plt>
mov    %eax,-0x4(%rbp)
jmp    1202 <ledWps+0xf2>
mov    -0x8(%rbp),%edi
mov    $0x1,%edx
mov    $0xa,%ecx
mov    $0x5,%r8d
mov    $0xfa0,%r9d
mov    %edx,%esi
call   1030 <gpioLedSet@plt>
mov    %eax,-0x4(%rbp)
jmp    1202 <ledWps+0xf2>
mov    -0x8(%rbp),%edi
mov    $0xbb8,%esi
mov    $0x1,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <gpioLedSet@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledWps>:
push   %rax
add    $0xffffffff,%esi
cmp    $0x4,%esi
ja     1196 <ledWps+0x86>
lea    0xee0(%rip),%rax
movslq (%rax,%rsi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %esi,%esi
mov    $0xfa0,%edx
mov    $0x1,%ecx
jmp    114d <ledWps+0x3d>
mov    $0x2,%esi
jmp    1143 <ledWps+0x33>
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0xfa0,%ecx
mov    $0x1,%r8d
jmp    116a <ledWps+0x5a>
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0xa,%ecx
mov    $0x5,%r8d
mov    $0xfa0,%r9d
pop    %rax
jmp    1030 <gpioLedSet@plt>
mov    $0xbb8,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <gpioLedSet@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ledWps(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %22 [
i32 1, label %7
i32 2, label %10
i32 3, label %13
i32 4, label %16
i32 5, label %19
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @gpioLedSet(i32 %8, i32 0, i32 4000, i32 1, i32 1, i32 4000)
store i32 %9, i32* %3
br label %23
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @gpioLedSet(i32 %11, i32 2, i32 1, i32 4000, i32 1, i32 4000)
store i32 %12, i32* %3
br label %23
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i32 @gpioLedSet(i32 %14, i32 1, i32 1, i32 4000, i32 1, i32 4000)
store i32 %15, i32* %3
br label %23
16: ; preds = %2
%17 = load i32, i32* %4
%18 = call i32 @gpioLedSet(i32 %17, i32 1, i32 1, i32 10, i32 5, i32 4000)
store i32 %18, i32* %3
br label %23
19: ; preds = %2
%20 = load i32, i32* %4
%21 = call i32 @gpioLedSet(i32 %20, i32 3000, i32 1, i32 1, i32 1, i32 1)
br label %22
22: ; preds = %2, %19
store i32 0, i32* %3
br label %23
23: ; preds = %22, %16, %13, %10, %7
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @ledWps(i32 %0, i32 %1) {
switch i32 %1, label %13 [
i32 1, label %3
i32 2, label %5
i32 3, label %7
i32 4, label %9
i32 5, label %11
]
3: ; preds = %2
%4 = tail call i32 @gpioLedSet(i32 %0, i32 0, i32 4000, i32 1, i32 1, i32 4000)
br label %13
5: ; preds = %2
%6 = tail call i32 @gpioLedSet(i32 %0, i32 2, i32 1, i32 4000, i32 1, i32 4000)
br label %13
7: ; preds = %2
%8 = tail call i32 @gpioLedSet(i32 %0, i32 1, i32 1, i32 4000, i32 1, i32 4000)
br label %13
9: ; preds = %2
%10 = tail call i32 @gpioLedSet(i32 %0, i32 1, i32 1, i32 10, i32 5, i32 4000)
br label %13
11: ; preds = %2
%12 = tail call i32 @gpioLedSet(i32 %0, i32 3000, i32 1, i32 1, i32 1, i32 1)
br label %13
13: ; preds = %11, %2, %9, %7, %5, %3
%14 = phi i32 [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ %4, %3 ], [ 0, %2 ], [ 0, %11 ]
ret i32 %14
}