#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 */
scalar_t__ mp_hal_getButtonState(int);
int /*<<< orphan*/ utest_assertEqualsInt(int, int);
void testSwitches1(void) {
  utest_assertEqualsInt(0, (int)mp_hal_getButtonState(0));
  utest_assertEqualsInt(0, (int)mp_hal_getButtonState(1));
  utest_assertEqualsInt(0, (int)mp_hal_getButtonState(2));
  utest_assertEqualsInt(0, (int)mp_hal_getButtonState(3));
  utest_assertEqualsInt(-1, (int)mp_hal_getButtonState(999));
}


x86 assembly (clang, -O0):
<testSwitches1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mp_hal_getButtonState@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1030 <mp_hal_getButtonState@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1030 <mp_hal_getButtonState@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x3,%edi
call   1030 <mp_hal_getButtonState@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x3e7,%edi
call   1030 <mp_hal_getButtonState@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   1040 <utest_assertEqualsInt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSwitches1>:
push   %rax
xor    %edi,%edi
call   1030 <mp_hal_getButtonState@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1030 <mp_hal_getButtonState@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1030 <mp_hal_getButtonState@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x3,%edi
call   1030 <mp_hal_getButtonState@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1040 <utest_assertEqualsInt@plt>
mov    $0x3e7,%edi
call   1030 <mp_hal_getButtonState@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <utest_assertEqualsInt@plt>

LLVM IR (-O0):
define void @testSwitches1() {
%1 = call i64 @mp_hal_getButtonState(i32 0)
%2 = trunc i64 %1 to i32
%3 = call i32 @utest_assertEqualsInt(i32 0, i32 %2)
%4 = call i64 @mp_hal_getButtonState(i32 1)
%5 = trunc i64 %4 to i32
%6 = call i32 @utest_assertEqualsInt(i32 0, i32 %5)
%7 = call i64 @mp_hal_getButtonState(i32 2)
%8 = trunc i64 %7 to i32
%9 = call i32 @utest_assertEqualsInt(i32 0, i32 %8)
%10 = call i64 @mp_hal_getButtonState(i32 3)
%11 = trunc i64 %10 to i32
%12 = call i32 @utest_assertEqualsInt(i32 0, i32 %11)
%13 = call i64 @mp_hal_getButtonState(i32 999)
%14 = trunc i64 %13 to i32
%15 = call i32 @utest_assertEqualsInt(i32 -1, i32 %14)
ret void
}

LLVM IR (-O2):
define void @testSwitches1() {
%1 = tail call i64 @mp_hal_getButtonState(i32 0)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %2)
%4 = tail call i64 @mp_hal_getButtonState(i32 1)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %5)
%7 = tail call i64 @mp_hal_getButtonState(i32 2)
%8 = trunc i64 %7 to i32
%9 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %8)
%10 = tail call i64 @mp_hal_getButtonState(i32 3)
%11 = trunc i64 %10 to i32
%12 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %11)
%13 = tail call i64 @mp_hal_getButtonState(i32 999)
%14 = trunc i64 %13 to i32
%15 = tail call i32 @utest_assertEqualsInt(i32 -1, i32 %14)
ret void
}