#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 develop();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int i;
  int result;
  printf(" >>>>>start main function>>>>>> \n");
  result = develop();
  while (1) {
    for (i = 0; i < 1000; i++) {
      printf("this is a test program : %d \n", i);
      sleep(1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <develop@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1194 <main+0x64>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x2e>
jmp    1157 <main+0x27>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <develop@plt>
lea    0xea3(%rip),%rbx
nopl   (%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1170 <main+0x30>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [34 x i8] c" >>>>>start main function>>>>>> \0A\00"
@.str.1 = [30 x i8] c"this is a test program : %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @develop()
store i32 %5, i32* %3
br label %6
6: ; preds = %0, %17
store i32 0, i32* %2
br label %7
7: ; preds = %14, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1000
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @sleep(i32 1)
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
br label %6
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"this is a test program : %d \0A\00"
@str = [33 x i8] c" >>>>>start main function>>>>>> \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @develop()
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3, %4
%5 = phi i32 [ 0, %3 ], [ %8, %4 ]
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @sleep(i32 1)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %3, label %4
}