#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*/ braccioEsulta1();
int /*<<< orphan*/ braccioEsulta2();
int /*<<< orphan*/ braccioEsulta3();
int /*<<< orphan*/ braccioEsulta4();
int /*<<< orphan*/ pinzaClose();
int /*<<< orphan*/ pinzaOpen();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ usleep(int);
void thanks() {
  int w, i;
  for (w = 40; w <= 80; w += 20) {
    printf("w = %d \n\r", w);
    baseRuota(100, w);
    int j;
    for (i = 0; i < 3; i++) {
      pinzaOpen();
      braccioEsulta1();
      usleep(100000);
      pinzaClose();
      braccioEsulta2();
      usleep(100000);
      for (j = 0; j < 3; j++) {
        braccioEsulta3();
        pinzaClose();
        usleep(300000);
        pinzaOpen();
        braccioEsulta4();
        usleep(300000);
      }
    }
  }
  sleep(1);
}


x86 assembly (clang, -O0):
<thanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x28,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jg     128b <thanks+0xeb>
mov    -0x4(%rbp),%esi
lea    0xe3d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%esi
mov    $0x64,%edi
call   1030 <baseRuota@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1278 <thanks+0xd8>
mov    $0x0,%al
call   1040 <pinzaOpen@plt>
mov    $0x0,%al
call   10a0 <braccioEsulta1@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
mov    $0x0,%al
call   1080 <pinzaClose@plt>
mov    $0x0,%al
call   1070 <braccioEsulta2@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1265 <thanks+0xc5>
mov    $0x0,%al
call   1090 <braccioEsulta3@plt>
mov    $0x0,%al
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
mov    $0x0,%al
call   1040 <pinzaOpen@plt>
mov    $0x0,%al
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    121d <thanks+0x7d>
jmp    126a <thanks+0xca>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11dc <thanks+0x3c>
jmp    127d <thanks+0xdd>
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x4(%rbp)
jmp    11af <thanks+0xf>
mov    $0x1,%edi
call   10b0 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thanks>:
push   %r14
push   %rbx
push   %rax
mov    $0x14,%ebx
lea    0xe50(%rip),%r14
add    $0x14,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <baseRuota@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   10a0 <braccioEsulta1@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
xor    %eax,%eax
call   1070 <braccioEsulta2@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   10a0 <braccioEsulta1@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
xor    %eax,%eax
call   1070 <braccioEsulta2@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   10a0 <braccioEsulta1@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
xor    %eax,%eax
call   1070 <braccioEsulta2@plt>
mov    $0x186a0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1090 <braccioEsulta3@plt>
xor    %eax,%eax
call   1080 <pinzaClose@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
xor    %eax,%eax
call   1040 <pinzaOpen@plt>
xor    %eax,%eax
call   1060 <braccioEsulta4@plt>
mov    $0x493e0,%edi
call   10c0 <usleep@plt>
cmp    $0x3d,%ebx
jb     11b0 <thanks+0x10>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    10b0 <sleep@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"w = %d \0A\0D\00"
define void @thanks() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 40, i32* %1
br label %4
4: ; preds = %40, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 80
br i1 %6, label %7, label %43
7: ; preds = %4
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = call i32 @baseRuota(i32 100, i32 %10)
store i32 0, i32* %2
br label %12
12: ; preds = %36, %7
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %39
15: ; preds = %12
%16 = call i32 (...) @pinzaOpen()
%17 = call i32 (...) @braccioEsulta1()
%18 = call i32 @usleep(i32 100000)
%19 = call i32 (...) @pinzaClose()
%20 = call i32 (...) @braccioEsulta2()
%21 = call i32 @usleep(i32 100000)
store i32 0, i32* %3
br label %22
22: ; preds = %32, %15
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = call i32 (...) @braccioEsulta3()
%27 = call i32 (...) @pinzaClose()
%28 = call i32 @usleep(i32 300000)
%29 = call i32 (...) @pinzaOpen()
%30 = call i32 (...) @braccioEsulta4()
%31 = call i32 @usleep(i32 300000)
br label %32
32: ; preds = %25
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %22
35: ; preds = %22
br label %36
36: ; preds = %35
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %12
39: ; preds = %12
br label %40
40: ; preds = %39
%41 = load i32, i32* %1
%42 = add nsw i32 %41, 20
store i32 %42, i32* %1
br label %4
43: ; preds = %4
%44 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"w = %d \0A\0D\00"
define void @thanks() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 40, %0 ], [ %77, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @baseRuota(i32 100, i32 %2)
%5 = tail call i32 (...) @pinzaOpen()
%6 = tail call i32 (...) @braccioEsulta1()
%7 = tail call i32 @usleep(i32 100000)
%8 = tail call i32 (...) @pinzaClose()
%9 = tail call i32 (...) @braccioEsulta2()
%10 = tail call i32 @usleep(i32 100000)
%11 = tail call i32 (...) @braccioEsulta3()
%12 = tail call i32 (...) @pinzaClose()
%13 = tail call i32 @usleep(i32 300000)
%14 = tail call i32 (...) @pinzaOpen()
%15 = tail call i32 (...) @braccioEsulta4()
%16 = tail call i32 @usleep(i32 300000)
%17 = tail call i32 (...) @braccioEsulta3()
%18 = tail call i32 (...) @pinzaClose()
%19 = tail call i32 @usleep(i32 300000)
%20 = tail call i32 (...) @pinzaOpen()
%21 = tail call i32 (...) @braccioEsulta4()
%22 = tail call i32 @usleep(i32 300000)
%23 = tail call i32 (...) @braccioEsulta3()
%24 = tail call i32 (...) @pinzaClose()
%25 = tail call i32 @usleep(i32 300000)
%26 = tail call i32 (...) @pinzaOpen()
%27 = tail call i32 (...) @braccioEsulta4()
%28 = tail call i32 @usleep(i32 300000)
%29 = tail call i32 (...) @pinzaOpen()
%30 = tail call i32 (...) @braccioEsulta1()
%31 = tail call i32 @usleep(i32 100000)
%32 = tail call i32 (...) @pinzaClose()
%33 = tail call i32 (...) @braccioEsulta2()
%34 = tail call i32 @usleep(i32 100000)
%35 = tail call i32 (...) @braccioEsulta3()
%36 = tail call i32 (...) @pinzaClose()
%37 = tail call i32 @usleep(i32 300000)
%38 = tail call i32 (...) @pinzaOpen()
%39 = tail call i32 (...) @braccioEsulta4()
%40 = tail call i32 @usleep(i32 300000)
%41 = tail call i32 (...) @braccioEsulta3()
%42 = tail call i32 (...) @pinzaClose()
%43 = tail call i32 @usleep(i32 300000)
%44 = tail call i32 (...) @pinzaOpen()
%45 = tail call i32 (...) @braccioEsulta4()
%46 = tail call i32 @usleep(i32 300000)
%47 = tail call i32 (...) @braccioEsulta3()
%48 = tail call i32 (...) @pinzaClose()
%49 = tail call i32 @usleep(i32 300000)
%50 = tail call i32 (...) @pinzaOpen()
%51 = tail call i32 (...) @braccioEsulta4()
%52 = tail call i32 @usleep(i32 300000)
%53 = tail call i32 (...) @pinzaOpen()
%54 = tail call i32 (...) @braccioEsulta1()
%55 = tail call i32 @usleep(i32 100000)
%56 = tail call i32 (...) @pinzaClose()
%57 = tail call i32 (...) @braccioEsulta2()
%58 = tail call i32 @usleep(i32 100000)
%59 = tail call i32 (...) @braccioEsulta3()
%60 = tail call i32 (...) @pinzaClose()
%61 = tail call i32 @usleep(i32 300000)
%62 = tail call i32 (...) @pinzaOpen()
%63 = tail call i32 (...) @braccioEsulta4()
%64 = tail call i32 @usleep(i32 300000)
%65 = tail call i32 (...) @braccioEsulta3()
%66 = tail call i32 (...) @pinzaClose()
%67 = tail call i32 @usleep(i32 300000)
%68 = tail call i32 (...) @pinzaOpen()
%69 = tail call i32 (...) @braccioEsulta4()
%70 = tail call i32 @usleep(i32 300000)
%71 = tail call i32 (...) @braccioEsulta3()
%72 = tail call i32 (...) @pinzaClose()
%73 = tail call i32 @usleep(i32 300000)
%74 = tail call i32 (...) @pinzaOpen()
%75 = tail call i32 (...) @braccioEsulta4()
%76 = tail call i32 @usleep(i32 300000)
%77 = add nuw nsw i32 %2, 20
%78 = icmp ult i32 %2, 61
br i1 %78, label %1, label %79
79: ; preds = %1
%80 = tail call i32 @sleep(i32 1)
ret void
}