#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*/ dummy(int);
void led_blink(volatile unsigned int *gpio, float freq) {
  int i;
  for (i = 0; i < freq; i++) {
    dummy(i);
  };
  gpio[11] = (1 << 15);
  i = 0;
  for (i = 0; i < freq; i++) {
    dummy(i);
  };
  gpio[8] = (1 << 15);
}


x86 assembly (clang, -O0):
<led_blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1151 <led_blink+0x41>
mov    -0x10(%rbp),%edi
call   1030 <dummy@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <led_blink+0x18>
mov    -0x8(%rbp),%rax
movl   $0x8000,0x2c(%rax)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1193 <led_blink+0x83>
mov    -0x10(%rbp),%edi
call   1030 <dummy@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116a <led_blink+0x5a>
mov    -0x8(%rbp),%rax
movl   $0x8000,0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_blink>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    117e <led_blink+0x6e>
xor    %ebp,%ebp
movss  %xmm0,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <dummy@plt>
movss  0x4(%rsp),%xmm0
add    $0x1,%ebp
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
ucomiss %xmm1,%xmm0
ja     1130 <led_blink+0x20>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
movl   $0x8000,0x2c(%rbx)
jbe    1185 <led_blink+0x75>
xor    %ebp,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <dummy@plt>
add    $0x1,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
ja     1160 <led_blink+0x50>
jmp    1185 <led_blink+0x75>
movl   $0x8000,0x2c(%rbx)
movl   $0x8000,0x20(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @led_blink(i32* %0, float %1) {
%3 = alloca i32*
%4 = alloca float
%5 = alloca i32
store i32* %0, i32** %3
store float %1, float* %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = sitofp i32 %7 to float
%9 = load float, float* %4
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i32, i32* %5
%13 = call i32 @dummy(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 11
store volatile i32 32768, i32* %19
store i32 0, i32* %5
store i32 0, i32* %5
br label %20
20: ; preds = %28, %17
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to float
%23 = load float, float* %4
%24 = fcmp olt float %22, %23
br i1 %24, label %25, label %31
25: ; preds = %20
%26 = load i32, i32* %5
%27 = call i32 @dummy(i32 %26)
br label %28
28: ; preds = %25
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %20
31: ; preds = %20
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i64 8
store volatile i32 32768, i32* %33
ret void
}

LLVM IR (-O2):
define void @led_blink(i32* %0, float %1) {
%3 = fcmp ogt float %1, 0.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = getelementptr inbounds i32, i32* %0, i64 11
store volatile i32 32768, i32* %5
br label %20
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @dummy(i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = sitofp i32 %9 to float
%11 = fcmp olt float %10, %1
br i1 %11, label %6, label %12
12: ; preds = %6
%13 = getelementptr inbounds i32, i32* %0, i64 11
store volatile i32 32768, i32* %13
br i1 %3, label %14, label %20
14: ; preds = %12, %14
%15 = phi i32 [ %17, %14 ], [ 0, %12 ]
%16 = tail call i32 @dummy(i32 %15)
%17 = add nuw nsw i32 %15, 1
%18 = sitofp i32 %17 to float
%19 = fcmp olt float %18, %1
br i1 %19, label %14, label %20
20: ; preds = %14, %4, %12
%21 = getelementptr inbounds i32, i32* %0, i64 8
store volatile i32 32768, i32* %21
ret void
}