#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*/ big_delay();
int /*<<< orphan*/ delay();
int /*<<< orphan*/ led_init(int);
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ led_on();
int /*<<< orphan*/ rcc_init();
void startup(void) {
  int i;
  rcc_init();
  led_init(13);
  for (;;) {
    for (i = 0; i < 3; i++) {
      led_on();
      delay();
      led_off();
      delay();
    }
    big_delay();
  }
}


x86 assembly (clang, -O0):
<startup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rcc_init@plt>
mov    $0xd,%edi
call   1060 <led_init@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    11b4 <startup+0x54>
mov    $0x0,%al
call   1080 <led_on@plt>
mov    $0x0,%al
call   1070 <delay@plt>
mov    $0x0,%al
call   1030 <led_off@plt>
mov    $0x0,%al
call   1070 <delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <startup+0x20>
mov    $0x0,%al
call   1050 <big_delay@plt>
jmp    1179 <startup+0x19>

x86 assembly (clang, -O2):
<startup>:
push   %rax
xor    %eax,%eax
call   1040 <rcc_init@plt>
mov    $0xd,%edi
call   1060 <led_init@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <led_on@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1080 <led_on@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1080 <led_on@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1050 <big_delay@plt>
jmp    1180 <startup+0x20>

LLVM IR (-O0):
define void @startup() {
%1 = alloca i32
%2 = call i32 (...) @rcc_init()
%3 = call i32 @led_init(i32 13)
br label %4
4: ; preds = %16, %0
store i32 0, i32* %1
br label %5
5: ; preds = %13, %4
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = call i32 (...) @led_on()
%10 = call i32 (...) @delay()
%11 = call i32 (...) @led_off()
%12 = call i32 (...) @delay()
br label %13
13: ; preds = %8
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %5
16: ; preds = %5
%17 = call i32 (...) @big_delay()
br label %4
}

LLVM IR (-O2):
define void @startup() {
%1 = tail call i32 (...) @rcc_init()
%2 = tail call i32 @led_init(i32 13)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @led_on()
%5 = tail call i32 (...) @delay()
%6 = tail call i32 (...) @led_off()
%7 = tail call i32 (...) @delay()
%8 = tail call i32 (...) @led_on()
%9 = tail call i32 (...) @delay()
%10 = tail call i32 (...) @led_off()
%11 = tail call i32 (...) @delay()
%12 = tail call i32 (...) @led_on()
%13 = tail call i32 (...) @delay()
%14 = tail call i32 (...) @led_off()
%15 = tail call i32 (...) @delay()
%16 = tail call i32 (...) @big_delay()
br label %3
}