#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 atoi(char const *);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ usleep(int);
int main(int argc, char const *argv[]) {
  char package[100];
  int sleepTime, ii = 0;
  if (argc == 0) {
    printf("Specify in microseconds the send period\n");
    return -1;
  }
  sleepTime = atoi(argv[1]);
  printf("%d\n", sleepTime);
  while (1) {
    usleep(sleepTime);
    memset(package, ii, 100);
    printf("%s", package);
    ii++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x88(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1189 <main+0x49>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x90,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x84(%rbp),%edi
call   1060 <usleep@plt>
lea    -0x80(%rbp),%rdi
mov    -0x88(%rbp),%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    -0x80(%rbp),%rsi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
mov    %eax,-0x88(%rbp)
jmp    11b0 <main+0x70>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
test   %edi,%edi
je     11b9 <main+0x69>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%r15d
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
lea    0xe80(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1070 <usleep@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
jmp    1190 <main+0x40>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Specify in microseconds the send period\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 -1
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %13, %20
%21 = load i32, i32* %7
%22 = call i32 @usleep(i32 %21)
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%24 = load i32, i32* %8
%25 = call i32 @memset(i8* %23, i32 %24, i32 100)
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %20
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@str = [40 x i8] c"Specify in microseconds the send period\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 -1
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %13, %8
%14 = phi i32 [ 0, %8 ], [ %18, %13 ]
%15 = call i32 @usleep(i32 %11)
%16 = call i32 @memset(i8* %4, i32 %14, i32 100)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%18 = add nuw nsw i32 %14, 1
br label %13
}