#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*/ clear();
int /*<<< orphan*/ ptwalking_1();
int /*<<< orphan*/ ptwalking_2();
int /*<<< orphan*/ usleep(int);
void twalk() {
  clear();
  for (int i = 0; i < 10; i++) {
    ptwalking_1();
    usleep(300000);
    clear();
    ptwalking_2();
    usleep(300000);
    clear();
  }
}


x86 assembly (clang, -O0):
<twalk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <clear@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    119e <twalk+0x5e>
mov    $0x0,%al
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1050 <clear@plt>
mov    $0x0,%al
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1050 <clear@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <twalk+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twalk>:
push   %rax
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <ptwalking_1@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1040 <ptwalking_2@plt>
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <clear@plt>

LLVM IR (-O0):
define void @twalk() {
%1 = alloca i32
%2 = call i32 (...) @clear()
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = call i32 (...) @ptwalking_1()
%8 = call i32 @usleep(i32 300000)
%9 = call i32 (...) @clear()
%10 = call i32 (...) @ptwalking_2()
%11 = call i32 @usleep(i32 300000)
%12 = call i32 (...) @clear()
br label %13
13: ; preds = %6
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @twalk() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @ptwalking_1()
%3 = tail call i32 @usleep(i32 300000)
%4 = tail call i32 (...) @clear()
%5 = tail call i32 (...) @ptwalking_2()
%6 = tail call i32 @usleep(i32 300000)
%7 = tail call i32 (...) @clear()
%8 = tail call i32 (...) @ptwalking_1()
%9 = tail call i32 @usleep(i32 300000)
%10 = tail call i32 (...) @clear()
%11 = tail call i32 (...) @ptwalking_2()
%12 = tail call i32 @usleep(i32 300000)
%13 = tail call i32 (...) @clear()
%14 = tail call i32 (...) @ptwalking_1()
%15 = tail call i32 @usleep(i32 300000)
%16 = tail call i32 (...) @clear()
%17 = tail call i32 (...) @ptwalking_2()
%18 = tail call i32 @usleep(i32 300000)
%19 = tail call i32 (...) @clear()
%20 = tail call i32 (...) @ptwalking_1()
%21 = tail call i32 @usleep(i32 300000)
%22 = tail call i32 (...) @clear()
%23 = tail call i32 (...) @ptwalking_2()
%24 = tail call i32 @usleep(i32 300000)
%25 = tail call i32 (...) @clear()
%26 = tail call i32 (...) @ptwalking_1()
%27 = tail call i32 @usleep(i32 300000)
%28 = tail call i32 (...) @clear()
%29 = tail call i32 (...) @ptwalking_2()
%30 = tail call i32 @usleep(i32 300000)
%31 = tail call i32 (...) @clear()
%32 = tail call i32 (...) @ptwalking_1()
%33 = tail call i32 @usleep(i32 300000)
%34 = tail call i32 (...) @clear()
%35 = tail call i32 (...) @ptwalking_2()
%36 = tail call i32 @usleep(i32 300000)
%37 = tail call i32 (...) @clear()
%38 = tail call i32 (...) @ptwalking_1()
%39 = tail call i32 @usleep(i32 300000)
%40 = tail call i32 (...) @clear()
%41 = tail call i32 (...) @ptwalking_2()
%42 = tail call i32 @usleep(i32 300000)
%43 = tail call i32 (...) @clear()
%44 = tail call i32 (...) @ptwalking_1()
%45 = tail call i32 @usleep(i32 300000)
%46 = tail call i32 (...) @clear()
%47 = tail call i32 (...) @ptwalking_2()
%48 = tail call i32 @usleep(i32 300000)
%49 = tail call i32 (...) @clear()
%50 = tail call i32 (...) @ptwalking_1()
%51 = tail call i32 @usleep(i32 300000)
%52 = tail call i32 (...) @clear()
%53 = tail call i32 (...) @ptwalking_2()
%54 = tail call i32 @usleep(i32 300000)
%55 = tail call i32 (...) @clear()
%56 = tail call i32 (...) @ptwalking_1()
%57 = tail call i32 @usleep(i32 300000)
%58 = tail call i32 (...) @clear()
%59 = tail call i32 (...) @ptwalking_2()
%60 = tail call i32 @usleep(i32 300000)
%61 = tail call i32 (...) @clear()
ret void
}