#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*/ baseRuota(int, int);
int /*<<< orphan*/ pinzaRot(int, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ usleep(int);
void happy() {
  int i;
  baseRuota(30, 45);
  pinzaRot(100, 5);
  sleep(1);
  pinzaRot(100, 95);
  sleep(1);
  for (i = 0; i < 4; i++) {
    pinzaRot(2, 5);
    usleep(500000);
    pinzaRot(2, 95);
    usleep(500000);
  }
  sleep(1);
}


x86 assembly (clang, -O0):
<happy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1e,%edi
mov    $0x2d,%esi
call   1040 <baseRuota@plt>
mov    $0x64,%edi
mov    $0x5,%esi
call   1030 <pinzaRot@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x64,%edi
mov    $0x5f,%esi
call   1030 <pinzaRot@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    11da <happy+0x9a>
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5f,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <happy+0x50>
mov    $0x1,%edi
call   1050 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<happy>:
push   %rax
mov    $0x1e,%edi
mov    $0x2d,%esi
call   1040 <baseRuota@plt>
mov    $0x64,%edi
mov    $0x5,%esi
call   1030 <pinzaRot@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x64,%edi
mov    $0x5f,%esi
call   1030 <pinzaRot@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5f,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5f,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5f,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x2,%edi
mov    $0x5f,%esi
call   1030 <pinzaRot@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <sleep@plt>

LLVM IR (-O0):
define void @happy() {
%1 = alloca i32
%2 = call i32 @baseRuota(i32 30, i32 45)
%3 = call i32 @pinzaRot(i32 100, i32 5)
%4 = call i32 @sleep(i32 1)
%5 = call i32 @pinzaRot(i32 100, i32 95)
%6 = call i32 @sleep(i32 1)
store i32 0, i32* %1
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = call i32 @pinzaRot(i32 2, i32 5)
%12 = call i32 @usleep(i32 500000)
%13 = call i32 @pinzaRot(i32 2, i32 95)
%14 = call i32 @usleep(i32 500000)
br label %15
15: ; preds = %10
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %7
18: ; preds = %7
%19 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @happy() {
%1 = tail call i32 @baseRuota(i32 30, i32 45)
%2 = tail call i32 @pinzaRot(i32 100, i32 5)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @pinzaRot(i32 100, i32 95)
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @pinzaRot(i32 2, i32 5)
%7 = tail call i32 @usleep(i32 500000)
%8 = tail call i32 @pinzaRot(i32 2, i32 95)
%9 = tail call i32 @usleep(i32 500000)
%10 = tail call i32 @pinzaRot(i32 2, i32 5)
%11 = tail call i32 @usleep(i32 500000)
%12 = tail call i32 @pinzaRot(i32 2, i32 95)
%13 = tail call i32 @usleep(i32 500000)
%14 = tail call i32 @pinzaRot(i32 2, i32 5)
%15 = tail call i32 @usleep(i32 500000)
%16 = tail call i32 @pinzaRot(i32 2, i32 95)
%17 = tail call i32 @usleep(i32 500000)
%18 = tail call i32 @pinzaRot(i32 2, i32 5)
%19 = tail call i32 @usleep(i32 500000)
%20 = tail call i32 @pinzaRot(i32 2, i32 95)
%21 = tail call i32 @usleep(i32 500000)
%22 = tail call i32 @sleep(i32 1)
ret void
}