#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*/ acceleroInit();
int /*<<< orphan*/ setData(int, int /*<<< orphan*/);
int /*<<< orphan*/ setInOut(int, int /*<<< orphan*/);
int /*<<< orphan*/ timerInit();
void platformInit() {
  int i;
  for (i = 1; i <= 7; ++i) {
    setInOut(i, 0);
    setData(i, 0);
  }
  acceleroInit();
  timerInit();
}


x86 assembly (clang, -O0):
<platformInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jg     117b <platformInit+0x3b>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <setData@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <platformInit+0xf>
mov    $0x0,%al
call   1040 <acceleroInit@plt>
mov    $0x0,%al
call   1030 <timerInit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platformInit>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <setData@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1050 <setData@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1050 <setData@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1050 <setData@plt>
mov    $0x5,%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    $0x5,%edi
xor    %esi,%esi
call   1050 <setData@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1050 <setData@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1060 <setInOut@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1050 <setData@plt>
xor    %eax,%eax
call   1040 <acceleroInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <timerInit@plt>

LLVM IR (-O0):
define void @platformInit() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 7
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @setInOut(i32 %6, i32 0)
%8 = load i32, i32* %1
%9 = call i32 @setData(i32 %8, i32 0)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
%14 = call i32 (...) @acceleroInit()
%15 = call i32 (...) @timerInit()
ret void
}

LLVM IR (-O2):
define void @platformInit() {
%1 = tail call i32 @setInOut(i32 1, i32 0)
%2 = tail call i32 @setData(i32 1, i32 0)
%3 = tail call i32 @setInOut(i32 2, i32 0)
%4 = tail call i32 @setData(i32 2, i32 0)
%5 = tail call i32 @setInOut(i32 3, i32 0)
%6 = tail call i32 @setData(i32 3, i32 0)
%7 = tail call i32 @setInOut(i32 4, i32 0)
%8 = tail call i32 @setData(i32 4, i32 0)
%9 = tail call i32 @setInOut(i32 5, i32 0)
%10 = tail call i32 @setData(i32 5, i32 0)
%11 = tail call i32 @setInOut(i32 6, i32 0)
%12 = tail call i32 @setData(i32 6, i32 0)
%13 = tail call i32 @setInOut(i32 7, i32 0)
%14 = tail call i32 @setData(i32 7, i32 0)
%15 = tail call i32 (...) @acceleroInit()
%16 = tail call i32 (...) @timerInit()
ret void
}