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


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

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

LLVM IR (-O0):
define void @turnOn(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 (...) @C()
%10 = call i32 (...) @A()
%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 @turnOn(i32 %0) {
%2 = tail call i32 (...) @sendInit()
%3 = tail call i32 (...) @C()
%4 = tail call i32 (...) @A()
%5 = tail call i32 @setChannel(i32 %0)
%6 = tail call i32 @usDelay(i32 510000)
%7 = tail call i32 (...) @sendInit()
%8 = tail call i32 (...) @C()
%9 = tail call i32 (...) @A()
%10 = tail call i32 @setChannel(i32 %0)
%11 = tail call i32 @usDelay(i32 510000)
%12 = tail call i32 (...) @sendInit()
%13 = tail call i32 (...) @C()
%14 = tail call i32 (...) @A()
%15 = tail call i32 @setChannel(i32 %0)
%16 = tail call i32 @usDelay(i32 510000)
%17 = tail call i32 (...) @sendInit()
%18 = tail call i32 (...) @C()
%19 = tail call i32 (...) @A()
%20 = tail call i32 @setChannel(i32 %0)
%21 = tail call i32 @usDelay(i32 510000)
%22 = tail call i32 (...) @sendInit()
%23 = tail call i32 (...) @C()
%24 = tail call i32 (...) @A()
%25 = tail call i32 @setChannel(i32 %0)
%26 = tail call i32 @usDelay(i32 510000)
ret void
}