#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*/ blinker_n(int, int, unsigned int);
int /*<<< orphan*/ gpio_set(int, int);
int /*<<< orphan*/ sys_timer_wait(int);
void blink_int(unsigned int number) {
  unsigned int nibble, i;
  for (i = 0; i < 8; i++) {
    nibble = number;
    nibble >>= 28;
    number <<= 4;
    if (nibble == 0) {
      gpio_set(16, 0);
      sys_timer_wait(1000000);
      gpio_set(16, 1);
    } else {
      blinker_n(100000, 500000, nibble);
    }
    sys_timer_wait(2 * 1000000);
  }
}


x86 assembly (clang, -O0):
<blink_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jae    11c2 <blink_int+0x92>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1198 <blink_int+0x68>
mov    $0x10,%edi
xor    %esi,%esi
call   1040 <gpio_set@plt>
mov    $0xf4240,%edi
call   1050 <sys_timer_wait@plt>
mov    $0x10,%edi
mov    $0x1,%esi
call   1040 <gpio_set@plt>
jmp    11aa <blink_int+0x7a>
mov    -0x8(%rbp),%edx
mov    $0x186a0,%edi
mov    $0x7a120,%esi
call   1030 <blinker_n@plt>
mov    $0x1e8480,%edi
call   1050 <sys_timer_wait@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <blink_int+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink_int>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x8,%ebp
jmp    1166 <blink_int+0x36>
nopl   0x0(%rax)
mov    %ebx,%edx
shr    $0x1c,%edx
mov    $0x186a0,%edi
mov    $0x7a120,%esi
call   1030 <blinker_n@plt>
shl    $0x4,%ebx
mov    $0x1e8480,%edi
call   1050 <sys_timer_wait@plt>
add    $0xffffffff,%ebp
je     1195 <blink_int+0x65>
cmp    $0xfffffff,%ebx
ja     1140 <blink_int+0x10>
mov    $0x10,%edi
xor    %esi,%esi
call   1040 <gpio_set@plt>
mov    $0xf4240,%edi
call   1050 <sys_timer_wait@plt>
mov    $0x10,%edi
mov    $0x1,%esi
call   1040 <gpio_set@plt>
jmp    1154 <blink_int+0x24>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @blink_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %4
%7 = icmp ult i32 %6, 8
br i1 %7, label %8, label %28
8: ; preds = %5
%9 = load i32, i32* %2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 28
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 %12, 4
store i32 %13, i32* %2
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = call i32 @gpio_set(i32 16, i32 0)
%18 = call i32 @sys_timer_wait(i32 1000000)
%19 = call i32 @gpio_set(i32 16, i32 1)
br label %23
20: ; preds = %8
%21 = load i32, i32* %3
%22 = call i32 @blinker_n(i32 100000, i32 500000, i32 %21)
br label %23
23: ; preds = %20, %16
%24 = call i32 @sys_timer_wait(i32 2000000)
br label %25
25: ; preds = %23
%26 = load i32, i32* %4
%27 = add i32 %26, 1
store i32 %27, i32* %4
br label %5
28: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @blink_int(i32 %0) {
br label %2
2: ; preds = %1, %14
%3 = phi i32 [ 0, %1 ], [ %16, %14 ]
%4 = phi i32 [ %0, %1 ], [ %5, %14 ]
%5 = shl i32 %4, 4
%6 = icmp ult i32 %4, 268435456
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = tail call i32 @gpio_set(i32 16, i32 0)
%9 = tail call i32 @sys_timer_wait(i32 1000000)
%10 = tail call i32 @gpio_set(i32 16, i32 1)
br label %14
11: ; preds = %2
%12 = lshr i32 %4, 28
%13 = tail call i32 @blinker_n(i32 100000, i32 500000, i32 %12)
br label %14
14: ; preds = %11, %7
%15 = tail call i32 @sys_timer_wait(i32 2000000)
%16 = add nuw nsw i32 %3, 1
%17 = icmp eq i32 %16, 8
br i1 %17, label %18, label %2
18: ; preds = %14
ret void
}