#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*/ B();
int /*<<< orphan*/ sendInit();
int /*<<< orphan*/ setChannel(int);
int /*<<< orphan*/ usDelay(int);
void turnOff(int k) {
  unsigned int i;
  for (i = 1; i <= 5; i++) {
    sendInit();
    B();
    B();
    setChannel(k);
    usDelay(510000);
  }
}


x86 assembly (clang, -O0):
<turnOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
ja     1191 <turnOff+0x51>
mov    $0x0,%al
call   1030 <sendInit@plt>
mov    $0x0,%al
call   1040 <B@plt>
mov    $0x0,%al
call   1040 <B@plt>
mov    -0x4(%rbp),%edi
call   1060 <setChannel@plt>
mov    $0x7c830,%edi
call   1050 <usDelay@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <turnOff+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnOff>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <sendInit@plt>
xor    %eax,%eax
call   1040 <B@plt>
xor    %eax,%eax
call   1040 <B@plt>
mov    %ebx,%edi
call   1060 <setChannel@plt>
mov    $0x7c830,%edi
call   1050 <usDelay@plt>
xor    %eax,%eax
call   1030 <sendInit@plt>
xor    %eax,%eax
call   1040 <B@plt>
xor    %eax,%eax
call   1040 <B@plt>
mov    %ebx,%edi
call   1060 <setChannel@plt>
mov    $0x7c830,%edi
call   1050 <usDelay@plt>
xor    %eax,%eax
call   1030 <sendInit@plt>
xor    %eax,%eax
call   1040 <B@plt>
xor    %eax,%eax
call   1040 <B@plt>
mov    %ebx,%edi
call   1060 <setChannel@plt>
mov    $0x7c830,%edi
call   1050 <usDelay@plt>
xor    %eax,%eax
call   1030 <sendInit@plt>
xor    %eax,%eax
call   1040 <B@plt>
xor    %eax,%eax
call   1040 <B@plt>
mov    %ebx,%edi
call   1060 <setChannel@plt>
mov    $0x7c830,%edi
call   1050 <usDelay@plt>
xor    %eax,%eax
call   1030 <sendInit@plt>
xor    %eax,%eax
call   1040 <B@plt>
xor    %eax,%eax
call   1040 <B@plt>
mov    %ebx,%edi
call   1060 <setChannel@plt>
mov    $0x7c830,%edi
pop    %rbx
jmp    1050 <usDelay@plt>

LLVM IR (-O0):
define void @turnOff(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp ule i32 %5, 5
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = call i32 (...) @sendInit()
%9 = call i32 (...) @B()
%10 = call i32 (...) @B()
%11 = load i32, i32* %2
%12 = call i32 @setChannel(i32 %11)
%13 = call i32 @usDelay(i32 510000)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @turnOff(i32 %0) {
%2 = tail call i32 (...) @sendInit()
%3 = tail call i32 (...) @B()
%4 = tail call i32 (...) @B()
%5 = tail call i32 @setChannel(i32 %0)
%6 = tail call i32 @usDelay(i32 510000)
%7 = tail call i32 (...) @sendInit()
%8 = tail call i32 (...) @B()
%9 = tail call i32 (...) @B()
%10 = tail call i32 @setChannel(i32 %0)
%11 = tail call i32 @usDelay(i32 510000)
%12 = tail call i32 (...) @sendInit()
%13 = tail call i32 (...) @B()
%14 = tail call i32 (...) @B()
%15 = tail call i32 @setChannel(i32 %0)
%16 = tail call i32 @usDelay(i32 510000)
%17 = tail call i32 (...) @sendInit()
%18 = tail call i32 (...) @B()
%19 = tail call i32 (...) @B()
%20 = tail call i32 @setChannel(i32 %0)
%21 = tail call i32 @usDelay(i32 510000)
%22 = tail call i32 (...) @sendInit()
%23 = tail call i32 (...) @B()
%24 = tail call i32 (...) @B()
%25 = tail call i32 @setChannel(i32 %0)
%26 = tail call i32 @usDelay(i32 510000)
ret void
}