#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*/ mp_hal_setLed(int, int);
int /*<<< orphan*/ mp_hal_testLed(int);
int /*<<< orphan*/ mp_hal_toggleLed(int);
int /*<<< orphan*/ utest_assertEqualsInt(int, int /*<<< orphan*/);
void testLeds3(void) {
  mp_hal_setLed(0, 1);
  mp_hal_setLed(1, 0);
  mp_hal_setLed(2, 0);
  mp_hal_toggleLed(0);
  utest_assertEqualsInt(0, mp_hal_testLed(0));
  utest_assertEqualsInt(0, mp_hal_testLed(1));
  utest_assertEqualsInt(0, mp_hal_testLed(2));
  mp_hal_toggleLed(1);
  utest_assertEqualsInt(0, mp_hal_testLed(0));
  utest_assertEqualsInt(1, mp_hal_testLed(1));
  utest_assertEqualsInt(0, mp_hal_testLed(2));
  mp_hal_toggleLed(2);
  utest_assertEqualsInt(0, mp_hal_testLed(0));
  utest_assertEqualsInt(1, mp_hal_testLed(1));
  utest_assertEqualsInt(1, mp_hal_testLed(2));
}


x86 assembly (clang, -O0):
<testLeds3>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <mp_hal_setLed@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <mp_hal_setLed@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1050 <mp_hal_setLed@plt>
xor    %edi,%edi
call   1030 <mp_hal_toggleLed@plt>
xor    %edi,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1030 <mp_hal_toggleLed@plt>
xor    %edi,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1030 <mp_hal_toggleLed@plt>
xor    %edi,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1040 <mp_hal_testLed@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1060 <utest_assertEqualsInt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLeds3>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <mp_hal_setLed@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <mp_hal_setLed@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1050 <mp_hal_setLed@plt>
xor    %edi,%edi
call   1030 <mp_hal_toggleLed@plt>
xor    %edi,%edi
call   1040 <mp_hal_testLed@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1040 <mp_hal_testLed@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1040 <mp_hal_testLed@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1030 <mp_hal_toggleLed@plt>
xor    %edi,%edi
call   1040 <mp_hal_testLed@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1040 <mp_hal_testLed@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1040 <mp_hal_testLed@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1030 <mp_hal_toggleLed@plt>
xor    %edi,%edi
call   1040 <mp_hal_testLed@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x1,%edi
call   1040 <mp_hal_testLed@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1060 <utest_assertEqualsInt@plt>
mov    $0x2,%edi
call   1040 <mp_hal_testLed@plt>
mov    $0x1,%edi
mov    %eax,%esi
pop    %rax
jmp    1060 <utest_assertEqualsInt@plt>

LLVM IR (-O0):
define void @testLeds3() {
%1 = call i32 @mp_hal_setLed(i32 0, i32 1)
%2 = call i32 @mp_hal_setLed(i32 1, i32 0)
%3 = call i32 @mp_hal_setLed(i32 2, i32 0)
%4 = call i32 @mp_hal_toggleLed(i32 0)
%5 = call i32 @mp_hal_testLed(i32 0)
%6 = call i32 @utest_assertEqualsInt(i32 0, i32 %5)
%7 = call i32 @mp_hal_testLed(i32 1)
%8 = call i32 @utest_assertEqualsInt(i32 0, i32 %7)
%9 = call i32 @mp_hal_testLed(i32 2)
%10 = call i32 @utest_assertEqualsInt(i32 0, i32 %9)
%11 = call i32 @mp_hal_toggleLed(i32 1)
%12 = call i32 @mp_hal_testLed(i32 0)
%13 = call i32 @utest_assertEqualsInt(i32 0, i32 %12)
%14 = call i32 @mp_hal_testLed(i32 1)
%15 = call i32 @utest_assertEqualsInt(i32 1, i32 %14)
%16 = call i32 @mp_hal_testLed(i32 2)
%17 = call i32 @utest_assertEqualsInt(i32 0, i32 %16)
%18 = call i32 @mp_hal_toggleLed(i32 2)
%19 = call i32 @mp_hal_testLed(i32 0)
%20 = call i32 @utest_assertEqualsInt(i32 0, i32 %19)
%21 = call i32 @mp_hal_testLed(i32 1)
%22 = call i32 @utest_assertEqualsInt(i32 1, i32 %21)
%23 = call i32 @mp_hal_testLed(i32 2)
%24 = call i32 @utest_assertEqualsInt(i32 1, i32 %23)
ret void
}

LLVM IR (-O2):
define void @testLeds3() {
%1 = tail call i32 @mp_hal_setLed(i32 0, i32 1)
%2 = tail call i32 @mp_hal_setLed(i32 1, i32 0)
%3 = tail call i32 @mp_hal_setLed(i32 2, i32 0)
%4 = tail call i32 @mp_hal_toggleLed(i32 0)
%5 = tail call i32 @mp_hal_testLed(i32 0)
%6 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %5)
%7 = tail call i32 @mp_hal_testLed(i32 1)
%8 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %7)
%9 = tail call i32 @mp_hal_testLed(i32 2)
%10 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %9)
%11 = tail call i32 @mp_hal_toggleLed(i32 1)
%12 = tail call i32 @mp_hal_testLed(i32 0)
%13 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %12)
%14 = tail call i32 @mp_hal_testLed(i32 1)
%15 = tail call i32 @utest_assertEqualsInt(i32 1, i32 %14)
%16 = tail call i32 @mp_hal_testLed(i32 2)
%17 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %16)
%18 = tail call i32 @mp_hal_toggleLed(i32 2)
%19 = tail call i32 @mp_hal_testLed(i32 0)
%20 = tail call i32 @utest_assertEqualsInt(i32 0, i32 %19)
%21 = tail call i32 @mp_hal_testLed(i32 1)
%22 = tail call i32 @utest_assertEqualsInt(i32 1, i32 %21)
%23 = tail call i32 @mp_hal_testLed(i32 2)
%24 = tail call i32 @utest_assertEqualsInt(i32 1, i32 %23)
ret void
}